How The Spectroscope Revealed What Stars Are Made Of

Photo: Vanessa Loring / Pexels
In 1835, French philosopher Auguste Comte declared the chemical composition of stars permanently unknowable, calling it a fact forever beyond scientific reach since no instrument could physically visit or sample one. He was wrong within a single generation. By the 1860s, physicists Gustav Kirchhoff and Robert Bunsen had shown that starlight itself carries a readable chemical signature, and the instrument that read it, the spectroscope, became one of the most consequential inventions in the history of astronomy.
The instrument that turned light into a fingerprint
A spectroscope is an optical instrument that splits light into its component wavelengths, usually with a prism or a diffraction grating, and presents that spread-out spectrum for direct visual inspection through an eyepiece. The basic physics is centuries old. Isaac Newton showed in 1666 that a glass prism separates white sunlight into the familiar rainbow band, from red at the long-wavelength end to violet at the short-wavelength end, and correctly argued that this spread reflected a real property of light rather than something the prism itself added.
What Newton did not have was the resolving precision to notice that the rainbow was not perfectly smooth. That took nearly 150 more years and a level of optical craftsmanship that, by coincidence, came from a glassmaker who had no formal astronomical training at all.
The instrument's value comes from a single physical fact: light does not just tell you that something is glowing, it tells you what that something is made of, how hot it is, and how fast it is moving relative to you, all encoded in the precise pattern of wavelengths present or missing from the beam. No other 19th-century measurement technique could extract that much information from an object the observer could never touch.
Fraunhofer's catalog of missing colors
Joseph von Fraunhofer was a Bavarian optician who had spent his career manufacturing precision lenses and prisms of a quality no rival workshop in Europe could match. English chemist William Hyde Wollaston had actually noticed a handful of dark gaps in the solar spectrum first, in 1802, using a crude prism setup, but he treated them as boundaries between natural colors and did not investigate further. Fraunhofer, working independently and with far better optics, rediscovered the same gaps in 1814 while testing prisms for his own instruments, and this time the observation did not get dropped.
When Fraunhofer passed sunlight through a narrow slit and then a high-quality prism, the resulting spectrum was crossed by hundreds of thin, dark vertical lines at specific, perfectly repeatable positions. He measured and cataloged more than 570 of them, assigning the most prominent lines letters from A through K, a labeling system astronomers still reference today. He had no theoretical explanation for what caused them. He simply measured their positions with a precision no one had achieved before, using a purpose-built spectroscope of his own design that could rotate to read the angle of each line with high accuracy.
One detail turned out to matter enormously in hindsight. Fraunhofer noticed that a prominent dark line he labeled "D" fell at exactly the same position as the bright yellow light given off by a sodium flame. He recorded the coincidence without knowing what to make of it. That single unexplained match sat in the scientific literature for 45 years before anyone connected it to a general theory of how matter and light interact.
Fraunhofer died in 1826 at age 39, likely from tuberculosis linked to years of exposure to heavy-metal glass compounds in his optical workshop. He never learned what caused the lines that now bear his name.
Kirchhoff, Bunsen, and the theory that explained everything
The explanation came from Gustav Kirchhoff, a physicist, and Robert Bunsen, a chemist (and the inventor of the Bunsen burner, whose clean, nearly colorless flame was itself essential to the discovery, since it let heated samples' own light show up without being swamped by flame color). Working together at the University of Heidelberg starting in 1859, they built an improved spectroscope and systematically heated pure chemical samples in Bunsen's burner flame, recording exactly which wavelengths of light each element emitted.
They found that every heated element produces light only at a specific, repeatable set of wavelengths, a bright-line emission pattern unique to that element, the way a fingerprint is unique to a person. Sodium always produced the same pair of tight yellow lines. Potassium produced a different pattern entirely. No two elements they tested produced the same set of lines.
Then came the insight that made the whole discipline possible. Kirchhoff showed that a cooler gas positioned between a hotter light source and an observer absorbs light at precisely the same wavelengths it would emit if it were the one glowing. Pass white light containing all wavelengths through a cloud of cool sodium vapor, and the exact same two yellow wavelengths that sodium emits when heated get stripped out of the beam instead, leaving dark lines at those positions in an otherwise continuous spectrum. Kirchhoff formalized this relationship in what became known as Kirchhoff's laws of spectroscopy, published jointly with Bunsen in 1860 in a paper titled "Chemical Analysis by Spectral Observations."
Fraunhofer's sodium "D" line finally made sense. Sunlight leaving the Sun's hot interior passes through cooler gas in the Sun's outer atmosphere before reaching Earth, and that cooler gas absorbs light at the exact wavelengths that match the elements present in it, sodium among them. The Sun was not missing those colors at the source. Its own atmosphere was quietly filtering them out, and the pattern of what got filtered was a direct readout of what elements were up there.
Within a year, Kirchhoff and Bunsen turned the technique from an explanation into a discovery engine. In May 1860, while spectroscopically analyzing mineral water from a spring near Bad Dürkheim, Germany, they spotted a spectral line pattern that matched no known element, sky-blue in color. They named the new element caesium, from the Latin caesius, meaning sky-blue, becoming the first element ever discovered by spectroscopic analysis rather than by conventional chemistry. A year later, in 1861, the same technique yielded a second new element, rubidium, named for the deep red lines in its spectrum. Spectroscopy had gone, in under two years, from an unexplained curiosity to a working tool for discovering matter no one had ever isolated.
Why every element writes its own signature in light
The physical reason each element produces a unique fingerprint comes down to quantum structure. Electrons in an atom cannot occupy any arbitrary energy level; they are restricted to a specific, discrete set of allowed energy states determined by that element's atomic structure, the number of protons in its nucleus and the resulting arrangement of its electron shells. When an electron drops from a higher allowed energy level to a lower one, it emits a photon whose energy, and therefore whose wavelength, exactly matches the size of that particular energy gap. Absorb a photon of that same exact energy, and an electron can jump the other way, from the lower level to the higher one, removing that specific wavelength from any light passing through.
Because no two elements share an identical arrangement of electron energy levels, no two elements produce an identical set of spectral lines. Hydrogen's single electron produces a comparatively simple, well-known pattern, the Balmer series, with prominent lines in the red, blue-green, and violet part of the visible spectrum. Iron, with 26 electrons distributed across a much more complicated shell structure, produces thousands of possible transitions and a correspondingly dense forest of spectral lines. Complexity of the pattern scales roughly with the complexity of the atom.
A useful analogy: think of each element's electrons as a unique set of tuning forks bolted permanently to that element. Strike them, whether with heat, an electric spark, or a burner flame, and each rings at its own specific, unchanging pitch, never at another element's pitch. A spectroscope is essentially an instrument for listening to that light "pitch" with enough precision to identify exactly which set of tuning forks is ringing, even when the tuning forks in question are 150 million kilometers away inside the Sun, or trillions of kilometers away inside a star that light took centuries to reach Earth from.
A second analogy helps with the absorption half of the story. Imagine a stained-glass window made of many small colored panes, each pane only letting through light of its own specific color and blocking every other wavelength. White light shining through the whole window emerges with certain colors missing, not because the window added anything, but because it selectively removed exactly the wavelengths its glass could not pass. A cool gas cloud in a star's outer atmosphere behaves the same way toward the light rising through it from below: not adding color, subtracting very specific bands of it, in a pattern that only that gas's chemical makeup could produce.
Why do dark lines appear instead of bright ones in starlight?
Starlight originates as a broad, continuous spectrum from the hot, dense interior. As that light passes outward through the star's cooler, thinner outer atmosphere, gas there absorbs light at its own characteristic wavelengths and re-emits it in random directions, not just toward Earth. The result is a spectrum with dark gaps at those wavelengths, called absorption lines, rather than the bright emission lines you would see if you were instead viewing that gas directly, glowing against a dark background.
From sunlight to starlight, and one accidental discovery
Kirchhoff and Bunsen tested their theory first on the Sun, since it was the only star bright enough for the primitive spectroscopes of the 1860s to analyze in detail. They matched dozens of dark absorption lines in the solar spectrum to known laboratory spectra and confirmed that the Sun contains sodium, iron, calcium, magnesium, and other elements familiar from Earth's own chemistry, a direct chemical readout of an object 150 million kilometers away that no one would ever visit or sample.
The technique did not stay confined to the Sun for long. Astronomers pointed increasingly sensitive spectroscopes at brighter stars throughout the 1860s and 1870s and found the same kind of dark-line fingerprints, meaning the same chemical elements found on Earth and in the Sun were present in stars scattered across the galaxy. This was, quietly, one of the most significant findings in the history of science: it meant the same physics and the same chemistry govern matter everywhere in the observable universe, not just locally. Comte's 1835 claim of permanent unknowability was not just wrong, it was wrong in the most totalizing way possible, since the technique revealed a universal chemistry rather than a merely local one.
The most celebrated single discovery from this era came in 1868, during a total solar eclipse observed from Guntur, India. French astronomer Pierre Janssen used the eclipse's brief darkness to study the Sun's outer atmosphere, the chromosphere, in detail and noticed a bright yellow spectral line close to, but distinctly separate from, the known sodium lines. Independently, English astronomer Norman Lockyer observed the same unexplained line from England later that year and, working with chemist Edward Frankland, concluded it did not match any known terrestrial element. They proposed a new element and named it helium, after Helios, the Greek god of the Sun.
Many scientists at the time were skeptical that an element could be confirmed to exist purely from a spectral line with no physical sample in hand. That skepticism held for 27 years. In 1895, Scottish chemist William Ramsay isolated helium gas on Earth for the first time, extracting it from the uranium-bearing mineral cleveite, and confirmed its spectral signature matched exactly what Lockyer and Janssen had observed in the Sun nearly three decades earlier. Helium remains, to date, the only element ever discovered in space before it was found on Earth, a fact that stands as one of the clearest demonstrations of spectroscopy's predictive power.
What a spectrograph adds to raw spectroscopy
A spectroscope lets a human eye view a spectrum directly through an eyepiece, useful for identifying obvious bright emission lines or gross features but limited by the eye's sensitivity and the impossibility of making a permanent, precisely measurable record. A spectrograph instead photographs, or in modern instruments digitally records, the spectrum, producing a permanent dataset that can be measured to fractions of a nanometer, compared against reference spectra, and analyzed by computer long after the light itself is gone.
This distinction mattered enormously for the maturation of the field. Early 19th-century work by Fraunhofer, Kirchhoff, and Bunsen relied on visual spectroscopes and painstaking hand-drawn records. The shift to photographic spectrographs in the late 1800s, pioneered in part by Harvard College Observatory's photographic sky surveys, allowed astronomers to capture and archive the spectra of thousands of stars for systematic comparison, something no eye at an eyepiece could do reliably.
That archive became the foundation for one of astronomy's most underappreciated achievements. Between the 1880s and 1924, a team of researchers at Harvard, including Williamina Fleming, Antonia Maury, and Annie Jump Cannon, examined hundreds of thousands of photographic stellar spectra and developed the classification system, ranging from hot blue-white O-type stars through cooler red M-type stars, that astronomers still use today, commonly remembered by the mnemonic "Oh Be A Fine Girl/Guy, Kiss Me." Cannon alone personally classified the spectra of more than 350,000 stars over her career, work made possible only because photographic spectrographs had turned fleeting light into a permanent, shareable record.
Modern astronomical instruments are, almost without exception, spectrographs rather than simple spectroscopes. Measuring the position of a spectral line to the precision modern astrophysics requires, sometimes to a few parts in ten million for detecting the tiny wobble a planet induces in its host star, requires digital detectors and computer analysis, not a fleeting glance through an eyepiece.
What spectral lines reveal beyond composition
Chemical identification was only the first layer of information spectroscopy unlocked. Once astronomers understood how to read a spectral fingerprint, they discovered the same lines carried several additional, independently readable signals.
| What is measured | What it reveals | Example use |
|---|---|---|
| Position of known absorption lines | Chemical elements present in the light source | Confirmed iron, calcium, sodium in the Sun (Kirchhoff & Bunsen, 1859–60) |
| Shift of lines toward red or blue | Motion toward or away from Earth (the Doppler effect) | Edwin Hubble's redshift measurements of receding galaxies, late 1920s |
| Width and shape of lines | Temperature, pressure, and rotation speed of the source | Distinguishing a giant star's low-pressure atmosphere from a dwarf star's denser one |
| Splitting of a single line into multiple close lines | Presence and strength of a magnetic field (the Zeeman effect) | Measuring magnetic field strength on sunspots and other stars |
| Relative strength of different lines | Approximate abundance of each element present | Estimating how much hydrogen versus heavier elements a star contains |
Five distinct properties of a distant object, chemical makeup, velocity, temperature, magnetic field, and elemental abundance, can all be extracted from the same beam of light without ever physically sampling the source.
The redshift row deserves particular attention because of where it led. In the late 1920s, astronomer Edwin Hubble combined distance measurements to nearby galaxies with spectroscopic redshift data (much of it gathered by fellow astronomer Vesto Slipher in the preceding decade) and found that more distant galaxies were receding from Earth faster than closer ones, a relationship now known as Hubble's Law. That single spectroscopic measurement, the systematic redshift of galaxy light, became the primary observational evidence for an expanding universe, a foundation that modern cosmology still stands on. For more on how that discovery unfolded, see Edwin Hubble: the man who discovered the universe.
How does spectroscopy measure a star's temperature?
A star's surface temperature governs which spectral lines appear strongest, because temperature determines how many electrons in a given element are in a state capable of producing a particular absorption line. Very hot stars show strong ionized-helium and hydrogen lines; cooler stars show strong lines from molecules and neutral metals instead. Astronomers compare the relative strength of different lines to known temperature-dependent patterns to estimate surface temperature without ever measuring it directly.
How is the Doppler effect used in spectroscopy?
When a light source moves away from an observer, its spectral lines shift toward longer, redder wavelengths (redshift); when it moves closer, the lines shift toward shorter, bluer wavelengths (blueshift). Measuring the size of that shift against a line's known rest-frame wavelength gives the object's velocity along the line of sight, a technique used for everything from galaxy recession to detecting the tiny gravitational tug of an orbiting exoplanet.
Why this matters beyond 19th-century chemistry
The practical reach of spectroscopy extends far past identifying elements in stars. The same core principle, that matter absorbs and emits light at signature wavelengths, underlies modern techniques across chemistry, medicine, industry, and planetary science. Infrared spectroscopy identifies unknown chemical compounds in forensic and pharmaceutical labs. Mass spectrometry (a different but conceptually related technique) is routine in drug testing and protein analysis. Atmospheric scientists use spectroscopic absorption to measure carbon dioxide and methane concentrations in Earth's atmosphere from satellites, without ever collecting a physical air sample from the altitude being measured.
The technique's most dramatic modern application may be exoplanet atmosphere analysis. When a planet passes in front of its host star, a small fraction of the star's light filters through the planet's thin atmosphere before reaching Earth's telescopes, and that filtered light carries the same kind of absorption fingerprint Fraunhofer first noticed in sunlight two centuries earlier. NASA's James Webb Space Telescope, operational since 2022, has used this exact method, transmission spectroscopy, to detect carbon dioxide, water vapor, and other molecules in the atmospheres of planets orbiting other stars, extending Fraunhofer's 1814 observation of missing colors in sunlight to atmospheres light-years away. The underlying physics has not changed since Kirchhoff's 1859 laws; only the sensitivity of the instruments has.
Spectroscopy also transformed how astronomers understand stellar evolution generally. The Harvard classification system built from photographic spectra, later refined into the Hertzsprung-Russell diagram relating stellar temperature to luminosity, gave astronomers a systematic way to place stars in categories corresponding to different stages of stellar life, from young hot blue stars to aging red giants to the compact remnants left behind after a star exhausts its nuclear fuel. None of that classification would have been possible from brightness or color alone; it required the fine-grained information locked in spectral lines.
Common misconceptions about spectroscopy
A common misunderstanding is that spectroscopy only identifies which elements are present in a light source. In practice, the same set of spectral lines simultaneously reveals a star's temperature, its rotation speed, its motion relative to Earth, its approximate elemental abundances, and even its magnetic field strength through line-splitting effects, making a single spectrum one of the most information-dense measurements available in all of astronomy.
Another misconception holds that spectral analysis requires physically visiting or sampling the object under study. This is, in fact, the entire point of the technique and precisely the claim it overturned: Auguste Comte's 1835 assertion that stellar composition was permanently unknowable rested on the assumption that chemical analysis required a physical sample. Kirchhoff and Bunsen's 1859-1860 work proved that assumption false; composition, and much more, can be read from light alone, across distances no spacecraft will ever cross.
A third, more subtle misconception is that dark absorption lines mean an element is "missing" from a star. The element is present in the outer atmosphere doing the absorbing, not absent. A dark line is evidence of an element's presence in a cooler outer layer, not evidence of a gap in the star's overall composition.
A fourth misconception treats "spectroscope" and "spectrograph" as interchangeable. As covered above, one is a viewing instrument and the other is a recording instrument, and the distinction mattered directly to the field's historical progress, since photographic and later digital spectrographs are what allowed 19th- and 20th-century astronomers to build the large, comparable datasets that turned isolated observations into systematic classification.
The takeaway
Fraunhofer spent years cataloging strange dark lines he could not explain, and Kirchhoff and Bunsen turned that mystery into a universal chemical fingerprinting method within a single generation, discovering two new elements, caesium and rubidium, along the way as direct proof the method worked. The technique then reached past the periodic table entirely: it identified helium in the Sun 27 years before anyone found it on Earth, gave Edwin Hubble the redshift data behind an expanding universe, and today lets NASA's James Webb Space Telescope read the atmospheres of planets orbiting stars light-years away. Comte was right that no one would ever physically visit a star. He was wrong that this made its composition unknowable, because the light a star sends across trillions of kilometers of empty space turns out to be sample enough.
Read next:
- Why the sky is blue, explained
- What is a photon, explained
- How the electron microscope sees tiny things
- Edwin Hubble: the man who discovered the universe
FAQ
Q: Who invented the spectroscope?
Joseph von Fraunhofer built the precision optical instruments in the early 1800s that revealed dark lines in the solar spectrum, cataloging more than 570 of them by 1814. Gustav Kirchhoff and Robert Bunsen explained the physical cause in 1859-1860, establishing spectroscopy as a tool for identifying chemical elements from light rather than a curious unexplained pattern.
Q: How do spectral lines reveal what a star is made of?
Each chemical element's electrons occupy specific, quantized energy levels, so the element absorbs or emits light only at precise, characteristic wavelengths tied to those levels. Matching the pattern of dark or bright lines in a star's spectrum against known laboratory fingerprints for each element identifies which elements are present in the star's outer atmosphere.
Q: Was helium really discovered in space before it was found on Earth?
Yes. Pierre Janssen and Norman Lockyer independently identified an unmatched spectral line in sunlight in 1868, and Lockyer, working with Edward Frankland, proposed a new element named helium. It was not isolated in a laboratory on Earth until 1895, by chemist William Ramsay, making it the only element ever discovered in space before being found on our own planet.
Q: What is the difference between a spectroscope and a spectrograph?
A spectroscope allows direct visual observation of a spectrum through an eyepiece, while a spectrograph records the spectrum photographically or digitally, producing a permanent, precisely measurable dataset. Nearly all modern astronomical instruments are spectrographs, since precision measurement requires recorded data rather than a fleeting visual glance.
Q: Can spectroscopy tell us how fast a star is moving?
Yes, through the Doppler effect. Shifts in the position of spectral lines toward red wavelengths indicate motion away from Earth, and shifts toward blue indicate motion toward Earth. Edwin Hubble used exactly this technique in the late 1920s, combined with distance measurements, to show that distant galaxies are receding from us faster the farther away they are.
Q: Did Kirchhoff and Bunsen discover any new elements using spectroscopy?
Yes. In 1860, while analyzing mineral water spectroscopically, they discovered caesium, identified by its sky-blue spectral lines. A year later, in 1861, the same technique led them to discover rubidium, named for its deep red spectral lines. These were the first two elements ever discovered by spectral analysis.
Q: Is spectroscopy still used in astronomy today?
Yes, extensively. NASA's James Webb Space Telescope uses transmission spectroscopy to detect molecules like water vapor and carbon dioxide in the atmospheres of exoplanets by analyzing starlight that filters through those atmospheres, using the same underlying absorption-line principle Fraunhofer first observed in sunlight in 1814.
Follow new articles
Add SciHub101 to your feed reader to see new science and technology stories.
About the Author
SciHub101 is an independent science and technology publication founded and edited by Buğra Sözeri, a software engineer and app developer based in Türkiye. AI tools assist with drafting and research. Source documentation in the existing archive is uneven, and articles are being reviewed and corrected. The Editorial Team byline identifies editorial responsibility; it does not certify specialist or independent human review. Where we compare products, anything built by our own team is labelled as such — see the editorial guidelines and About page for how corrections and disclosures work.





