Spectroscopy began with Isaac Newton using a prism to split light into a spectrum of colours. Today, spectroscopy uses diffraction gratings rather than prisms. We can also fit telescopes with tools called spectroscopes. These are used to split light up into different wavelengths.
We can use spectroscopy to work out the chemistry of a star. We do so by looking at the pattern of spectral lines. This method can also be used to tell us about the chemistry of the material that the light has passed through. This makes spectroscopy a powerful tool in the hunt for habitable exoplanets. It can look for chemicals like oxygen or methane in the planet's atmosphere.
Spectroscopy can tell us a great deal about objects in space. However, it is not a quick and easy tool. For example, one spectroscopy measurement can take the same amount of time as 100 photometry measurements. Spectroscopy also requires a lot of light, so cannot be used for very faint objects.