Transmission spectroscopy at UV wavelengths is a rich and largely unexplored source of information about the upper atmospheres of extrasolar planets . So far , UV transit observations have led to the detection of atomic hydrogen , oxygen and ionized carbon in the upper atmosphere of HD209458b . The interpretation of these observations is controversial – it is not clear if the absorption arises from an escaping atmosphere interacting with the stellar radiation and stellar wind , or the thermosphere inside the Roche lobe . In this paper , we introduce an empirical model that can be used to analyze UV transit depths of extrasolar planets . We use this model to interpret the transits of HD209458b in the H Lyman \alpha and the 1304 Å O I triplet emission lines . The results indicate that the mean temperature of the thermosphere is T = 8,000–11,000 K and that the H _ { 2 } /H dissociation front is located at pressures between p = 0.1–1 \mu bar , which correspond to an altitude of z \approx 1.1 R _ { p } . The upper boundary of the model thermosphere is located at altitudes between z = 2.7–3 R _ { p } , above which the atmosphere is mostly ionized . We find that the H I transit depth reflects the optical depth of the thermosphere in the wings of the H Lyman \alpha line but that the atmosphere also overflows the Roche lobe . By assuming a solar mixing ratio of oxygen , we obtain an O I transit depth that is statistically consistent with the observations . An O I transit depth comparable to or slightly larger than the H I transit depth is possible if the atmosphere is undergoing fast hydrodynamic escape , the O/H ratio is supersolar , or if a significant quantity of neutral oxygen is found outside the Roche lobe . We find that the observations can be explained solely by absorption in the upper atmosphere and extended clouds of ENAs or atoms strongly perturbed by radiation pressure are not required . Due to the large uncertainty in the data , repeated observations are necessary to better constrain the O I transit depths and thus the composition of the thermosphere .