  We present transmission spectra of the hot Jupiter HD 189733b taken with the
Space Telescope Imaging Spectrograph aboard HST. The spectra cover the
wavelength range 5808-6380 Ang with a resolving power of R=5000. We detect
absorption from the NaI doublet within the exoplanet's atmosphere at the 9
sigma confidence level within a 5 Ang band (absorption depth 0.09 +/- 0.01%)
and use the data to measure the doublet's spectral absorption profile. We
detect only the narrow cores of the doublet. The narrowness of the feature
could be due to an obscuring high-altitude haze of an unknown composition or a
significantly sub-solar NaI abundance hiding the line wings beneath a H2
Rayleigh signature. We compare the spectral absorption profile over 5.5 scale
heights with model spectral absorption profiles and constrain the temperature
at different atmospheric regions, allowing us to construct a vertical
temperature profile. We identify two temperature regimes; a 1280 +/- 240 K
region derived from the NaI doublet line wings corresponding to altitudes below
~ 500 km, and a 2800 +/- 400 K region derived from the NaI doublet line cores
corresponding to altitudes from ~ 500-4000 km. The zero altitude is defined by
the white-light radius of Rp/Rstar=0.15628 +/- 0.00009. The temperature rises
with altitude, which is likely evidence of a thermosphere. The absolute
pressure scale depends on the species responsible for the Rayleigh signature
and its abundance. We discuss a plausible scenario for this species, a
high-altitude silicate haze, and the atmospheric temperature-pressure profile
that results. In this case, the high altitude temperature rise for HD 189733b
occurs at pressures of 10^-5 to 10^-8 bar.
