A complete reassessment of the Hubble Space Telescope ( HST ) observations of the transits of the extrasolar planet HD 209458 b has provided a transmission spectrum of the atmosphere over a wide range of wavelengths . Analysis of the NaI absorption line profile has already shown that the sodium abundance has to drop by at least a factor of ten above a critical altitude . Here we analyze the profile in the deep core of the NaI doublet line from HST and high–resolution ground–based spectra to further constrain the vertical structure of the HD 209458 b atmosphere . With a wavelength–dependent cross section that spans more than 5 orders of magnitude , we use the absorption signature of the NaI doublet as an atmospheric probe . The NaI transmission features are shown to sample the atmosphere of HD 209458 b over an altitude range of more than 6 500 km , corresponding to a pressure range of 14 scale heights spanning 1 millibar to 10 ^ { -9 } bar pressures . By comparing the observations with a multi–layer model in which temperature is a free parameter at the resolution of the atmospheric scale height , we constrain the temperature vertical profile and variations in the Na abundance in the upper part of the atmosphere of HD 209458 b . We find a rise in temperature above the drop in sodium abundance at the 3 mbar level . We also identify an isothermal atmospheric layer at 1 500 \pm 100 K spanning almost 6 scale heights in altitude , from 10 ^ { -5 } to 10 ^ { -7 } bar . Above this layer , the temperature rises again to 2 500 ^ { +1 500 } _ { -1 000 } K at \sim 10 ^ { -9 } bar , indicating the presence of a thermosphere . The resulting temperature–pressure ( T–P ) profile agrees with the Na condensation scenario at the 3 mbar level , with a possible signature of sodium ionization at higher altitudes , near the 3 \times 10 ^ { -5 } bar level . Our T–P profile is found to be in good agreement with the profiles obtained with aeronomical models including hydrodynamic escape .