Creation of absorption lines

Astronomers can find traces of the composition of an exoplanets atmosphere in the light of its parent star, if the planet is in transit. Each chemical element in the atmosphere of the exoplanet blocks light of the star at specific wavelengths — creating absorption lines in the spectrum of the star. This way astronomers can identify the presence of specific atoms and molecules — like oxygen and water — on the exoplanet.