We present a theoretical model fit to the HST STIS optical transit transmission spectrum of HD 209458b. In our fit, we use the sodium absorption line profile along with the Rayleigh scattering by H2 to help determine the average temperature-pressure profile at the planetary terminator and infer the abundances of atomic and molecular species. The observed sodium line profile spans an altitude range of ~3500 km, corresponding to pressures between ~0.001 and 50 mbar in our atmospheric models. We find that the sodium line profile requires either condensation into sodium sulfide or ionization, necessary to deplete atomic sodium only at high altitudes below pressures of ~3 mbar. The depletion of sodium is supported by an observed sudden abundance change, from 2 times solar abundance in the lower atmosphere to 0.2 solar or lower in the upper atmosphere. Our findings also indicate the presence of a hot atmosphere near stratospheric altitudes corresponding to pressures of 33 mbar, consistent with that of the observed dayside temperature inversion. In addition, we find that a separate higher altitude temperature rise is necessary within both the condensation and ionization models, corresponding to pressures below ~0.01 mbar. This hot higher altitude temperature indicates that absorption by atomic sodium can potentially probe the bottom of the thermosphere and is possibly sensitive to the temperature rise linked to atmospheric escape.