In the collection How we know
How do we know what distant stars are made of?
Astronomers split starlight into a spectrum and read the dark or bright lines, which act as a unique fingerprint for each chemical element.
AI-drafted from web search results, then checked by a second, independent AI that read 4 of its 4 cited pages in full and found the thread supported after one error it found was corrected. No person has reviewed it.

The short answer
Astronomers identify what stars are made of by spreading their light into a spectrum and examining the pattern of lines in it. Each chemical element absorbs or emits light only at particular wavelengths, so the pattern works like a fingerprint or barcode. Stars are too far away to visit or sample, so this light is the main source of information about their makeup. [1] [2] [3]
Splitting light into a spectrum
Light has to be separated into its colors, or wavelengths, before it can be read. ESO compares this to raindrops dispersing sunlight into a rainbow, and notes that Newton named the result a spectrum. Modern instruments use a grating to spread the light out. Spectrographs disperse light far more than a rainbow does, record it on a CCD detector and save it as computer files for analysis. [2] [1]
The first astronomical use came in the 1810s, when Joseph von Fraunhofer mapped a pattern of dark lines in the spectrum of sunlight. Around 1860 Gustav Kirchhoff showed that the lines are the signatures of chemical elements. [2]
Why each element has its own pattern
The explanation lies in the electrons of atoms. Electrons normally sit in their lowest-energy arrangement, and a photon can lift one to a higher level only if the photon's energy matches the gap between levels. Those gaps differ from element to element, so each element absorbs at its own set of wavelengths. The electron soon releases the energy again, but the photon can go in any direction, so most of that light leaves our line of sight and a dark line appears at that wavelength. [1]
Three kinds of spectrum are involved. A continuous spectrum is the full rainbow from a hot, dense source. An absorption spectrum is dark lines on that rainbow, produced when light passes through a cooler, thin gas. An emission spectrum is a set of bright lines from a hot, thin gas. The wavelengths of an element's lines are the same in either case; conditions decide only whether they appear bright or dark. [3]
What the lines reveal
The position of the lines shows which elements are present, and the amount of light absorbed indicates how much of each there is. The lines also carry information about temperature, density and pressure. Motion shifts the lines through the Doppler effect, which lets astronomers measure a star's speed relative to Earth and detect planets orbiting other stars. [2] [4]
Crowded spectra from objects with many elements are harder to read. Computer modeling helps researchers separate the elements and recognize lines shifted by motion. The dark lines in a star's spectrum come from the thinner, cooler outer atmosphere, which astronomers use as an indicator of what the whole star is made of. [1] [3]
Composition also tells a historical story. Because stars gradually enrich the galaxy in heavier elements, Gaia's spectral analysis helps astronomers tell generations of stars apart and trace the galaxy's history of star formation. [4]
Sources
- Ask Astro: How do scientists determine the chemical ... (astronomy.com) Found by source search. Not checked by a person.
- Spectroscopy | ESO (eso.org) Found by source search. Not checked by a person.
- 5.3 Spectroscopy in Astronomy - Astronomy 2e | OpenStax (openstax.org) Found by source search. Not checked by a person.
- Spectroscopy (esa.int) Found by source search. Not checked by a person.
Questions to follow next
- How does the Doppler effect reveal planets around other stars?
- Why do some stars have different compositions from others?
- How did astronomers first work out what makes the Sun shine?