We present results from quantitative modeling and spectral analysis of the high mass X-ray binary Vela X-1 obtained with the Chandra HETGS. The spectra exhibit emission lines from H-like and He-like ions driven by photoionization, as well as fluorescent emission lines from several elements in lower charge states. In order to interpret and make full use of the high-quality data, we have developed a simulator, which calculates the ionization and thermal structure of a stellar wind photoionized by an X-ray source, and performs Monte Carlo simulations of X-ray photons propagating through the wind. The emergent spectra are then computed as a function of the viewing angle accurately accounting for photon transport in three dimensions including dynamics. From comparisons of the observed spectra with the simulation results, we are able to find the ionization structure and the geometrical distribution of material in Vela X-1 that can reproduce the observed spectral line intensities and continuum shapes at different orbital phases remarkably well. It is found that a large fraction of X-ray emission lines from highly ionized ions are formed in the region between the neutron star and the companion star. We also find that the fluorescent X-ray lines must be produced in at least three distinct regions --(1)the extended stellar wind, (2)reflection off the stellar photosphere, and (3)in a distribution of dense material partially covering and possibly trailing the neutron star, which may be associated with an accretion wake. Finally, from detailed analysis of the emission lines, we demonstrate that the stellar wind is affected by X-ray photoionization.