Menu

Stellar Absorption Spectra — How to Read the Dark Lines in Starlight

Every photon that reaches your telescope carries a confession. Pass that light through a prism and the confession spreads out — a rainbow cut by a forest of dark, sharp lines. Those lines are a star's chemistry, temperature, and motion, written in a language astronomers have been decoding for two hundred years. And on every star detail page on Nightbase, a live simulator draws exactly that spectrum for you.

14 min read Matthias Wüllenweber

Key Takeaways

  1. 1

    Starlight is a continuous rainbow (the continuum) crossed by dark absorption lines where specific atoms in the star's outer layers have stolen photons at their favourite wavelengths.

  2. 2

    Each element fingerprints a unique pattern. Hydrogen's Balmer series, calcium's H and K lines, and sodium's D doublet are the ones amateurs meet first.

  3. 3

    The differences between stellar spectra are mostly about temperature, not composition — a discovery Cecilia Payne made at 25 that rewrote stellar physics.

  4. 4

    The O–B–A–F–G–K–M classification you see in catalogues is really a thermometer, running from ~30,000 K down to ~2,500 K.

  5. 5

    The coolest stars are cool enough for whole molecules (TiO, C₂, CN) to survive — their spectra look like someone painted over them with wide dark brushes.

  6. 6

    Nightbase shows the predicted spectrum for any catalogued star in a live panel. Change the temperature, the lines rearrange themselves on cue.

What the Dark Lines Actually Are

Portrait of Joseph von Fraunhofer
Joseph von Fraunhofer — counted 574 dark lines in sunlight before anyone knew what they were.

In 1814 a Bavarian lens grinder named Joseph von Fraunhofer pointed a precision prism at the Sun. He expected a smooth rainbow. He saw, instead, a rainbow chopped by hundreds of razor-thin dark stripes. He labelled the most prominent ones A through K — Fraunhofer lines — and noted that the same lines appeared, slightly shifted, when he looked at Sirius and Castor. He had no idea what they were. He died fifteen years later still not knowing.

Half a century later Gustav Kirchhoff and Robert Bunsen lit the answer on a Heidelberg bench. A hot gas, they showed, emits bright lines at specific wavelengths that are unique to each element — sodium glows yellow at 589 nm, no matter whether it's in a flame or a supernova. A cooler gas placed between you and a hotter continuous source absorbs those same wavelengths. The Fraunhofer lines are shadows cast by specific atoms in the solar atmosphere, sitting above the blazing photosphere below.

Every star is a Bunsen burner turned inside out. The deep photosphere emits a thermal rainbow. A cooler gas layer just above it subtracts the wavelengths its atoms happen to like. What's left — continuum minus dips — is the spectrum we record.

Did you know?

Helium was discovered in the Sun before it was found on Earth. In 1868 astronomers spotted a bright yellow emission line during a solar eclipse that matched no known element. They named it after helios, the Sun. Terrestrial helium wasn't isolated until 1895.

K H G F b (Mg) D (Na) C (Hα) 380 nm 700 nm Fraunhofer's map of the solar spectrum (1814) Each dark band is an element — K, H = ionised calcium; D = sodium; C = hydrogen-α
Fraunhofer gave the strongest solar lines alphabetic labels. A century later, Kirchhoff matched each one to an element on Earth.

A Temperature Story, Not a Chemistry Story

Portrait of Cecilia Payne-Gaposchkin
Cecilia Payne-Gaposchkin — proved at 25 that stars are mostly hydrogen.

By 1900, Annie Jump Cannon at Harvard had classified the spectra of more than a quarter of a million stars, sorting them into the sequence we still use: O, B, A, F, G, K, M. Hot O stars showed helium lines and weak hydrogen. Cool M stars showed sprawling dark bands where no atomic line should be. A stars like Vega had the most brutal hydrogen Balmer lines of anyone.

The obvious conclusion, at the time, was that the stars had wildly different chemistry — some made of helium, some of hydrogen, some of metals, some of whatever made those strange molecular bands. Stellar spectra were a catalogue of alien elemental soups.

Then in 1925, a 25-year-old doctoral student named Cecilia Payne showed that almost all of it was wrong. Using the brand-new quantum physics of ionisation, she demonstrated that stellar spectra change from O to M because the outer layers get cooler. At 30,000 K, hydrogen is too hot — every atom is ionised, stripped of its electron, and ionised hydrogen can't absorb Balmer lines. At 3,000 K, hydrogen is too cold — the electron sits placidly in the ground state and ignores visible photons. Only at the in-between temperature of an A star, around 9,500 K, do hydrogen electrons live exactly on the second energy level, ready to leap when a red photon passes by.

Every star in the galaxy, Payne concluded, is made of essentially the same stuff — three-quarters hydrogen, a quarter helium, a trace of everything else. The spectra look different because the thermometers read different temperatures, not because the ingredients are different.

The reveal

Payne's thesis was called "undoubtedly the most brilliant PhD thesis ever written in astronomy" by Otto Struve decades later. At the time, the senior astronomer who reviewed it, Henry Norris Russell, made her add a paragraph calling her conclusion "almost certainly not real." Four years later he published the same result and got the credit for years.

30,000 K+O stars · He II ionised
10,000 KB stars · He I, weak H
9,500 KA stars · H Balmer peaks
6,000 KF/G · H fades, metals rise
4,500 KK stars · Ca II H, K, Na D
3,000 KM stars · molecules survive

Reading the Spectrum from O to M

Here's what each spectral class looks like in Nightbase's simulator, and the star on your next clear night where you can verify it.

B stars — hot enough for helium

At 25,000 K, Spica (B1 IV) is hot enough to ionise helium. A B-star spectrum is sparse: a few sharp He I lines (447, 471, 501 nm), a handful of faint Balmer lines, almost nothing else. The continuum blazes blue because the Planck curve peaks in the ultraviolet.

Rigel (B8 Ia), cooler at 12,100 K, sits at the B/A boundary. He I has started to fade; Balmer lines are growing fast.

A stars — the Balmer showcase

At ~9,500 K, hydrogen is at its sweet spot. Vega (A1 V, 9,600 K) and Sirius (A1 V, 9,984 K) display the most violent Balmer absorption of any class: at 656 nm carves a canyon out of the red; (486 nm), (434 nm), (410 nm) march in ever-closer spacing toward the ultraviolet, tracing the quantised energy levels of Bohr's hydrogen atom exactly.

Open Vega's detail page and scroll to the Stellar Absorption Spectrum panel. The four great hydrogen gashes are unmistakable. Compare it to Sirius on Sirius's page — nearly identical. That's why Sirius and Vega were once used as flux standards: their spectra are simple, reproducible, and dominated by one well-understood element.

F and G stars — the Sun's neighbourhood

Cool off to 6,500 K and Balmer weakens. What takes over are calcium II H and K at 393 and 397 nm — the two deepest lines in any Sun-like spectrum — plus a forest of iron lines and the sodium D doublet at 589 nm. This is Procyon (F5 IV-V, 6,516 K), and it is our own Sun (G2 V, 5,778 K). If you'd like to see a G-star spectrum tonight, look at Capella (G1 III + K0 III) — the brightest G-type star in our sky.

Sunlight through a CD

You don't need a spectroscope to see Fraunhofer lines. Angle an old CD or DVD toward a sunlit wall until it reflects the bright rainbow onto a piece of white paper. In the yellow band, look carefully: a pair of fine dark slits cuts the rainbow. That's the sodium D doublet — the same line that lights up sodium street lamps at night.

K stars — calcium takes over

Arcturus (K0 III, 4,291 K) is the canonical K-giant spectrum: Ca II H and K are now bottomless, Na D is obvious, hydrogen is a faint footnote. Aldebaran (K5 III, 3,881 K) pushes further down — faint TiO bands begin to appear in the red.

M stars — the molecule-dominated world

Below ~3,700 K, atoms can keep their electrons, and some atoms can even form molecules. Betelgeuse (M4 Ib, 3,479 K) and Antares (M1.5 Iab-Ib, 3,497 K) are the showpieces. Their spectra are barely recognisable: instead of sharp atomic needles, broad titanium oxide (TiO) bands mow down entire swaths of the red and near-infrared. The star still glows red-hot, but whole wavelength ranges are absorbed away by molecules in its atmosphere.

Open Betelgeuse's page and the simulator makes the jaw drop. The continuum sags in orange channels around 620, 670, and 705 nm where TiO devours photons. Hydrogen is invisible. Metals are lost in the molecular noise.

Why Vega Rules the Balmer Lines

The Balmer series is where you first feel quantum mechanics in an astronomical spectrum. A hydrogen electron sits on a ladder of discrete energy rungs. Starting from the second rung (the n = 2 level), it can absorb a photon and jump to n = 3 (that's Hα, 656 nm), to n = 4 (Hβ, 486 nm), to n = 5 (Hγ), to n = 6 (Hδ), and so on — each leap requiring a larger, bluer photon. The series crowds ever tighter toward a limit at 365 nm, the Balmer break, where infinity rungs merge into a continuum.

Angelo Secchi's 1870 chromolithograph of four stellar spectrum types. The top panel labelled '1st type: Sirius, Vega, Altair, Regulus' shows a bright rainbow interrupted by four bold dark bands at the Fraunhofer letters C, F, V and W — the hydrogen Balmer series. Below, 2nd type (Sun, Pollux, Arcturus, Procyon), 3rd type (α Her, α Ori, Antares) and 4th type (carbon stars) show progressively denser and more molecular absorption patterns.
Angelo Secchi's 1870 chromolithograph of stellar spectra. Fig. 1 (top) is exactly the case we're describing: Sirius, Vega, Altair and Regulus, with the Balmer lines carving four heavy dark bands at Fraunhofer C (Hα), F (Hβ) and the violet. The lower panels preview where the rest of this article is going — Sun-like stars, red giants, and carbon stars. Public domain.

Why does Vega show them so clearly? Because at 9,500 K, most hydrogen atoms have their electron excited to exactly n = 2 (thermally, by collisions with photons and other atoms). A photon passing by can pick any atom up to a higher rung. Hotter, and the electrons are stripped off entirely — ionised hydrogen doesn't absorb at all. Colder, and the electrons fall back to n = 1, where they can only absorb ultraviolet Lyman photons that are hidden from our telescopes by Earth's atmosphere.

A stars are the hydrogen sweet spot. That's why they dominate every introductory spectroscopy chart.

One ladder, many stars

Every hydrogen atom in the universe uses the same ladder. So the exact same wavelengths of the Balmer series appear in Vega, Sirius, a solar flare, the Orion Nebula, and a distant quasar. The differences between those objects aren't the lines' positions — the positions are laws of physics — but the depth and Doppler shift of those lines.

When Molecules Survive

The coolest stars don't look like the warmer ones with a temperature dial turned down. They look like a different kind of object entirely, because they are cool enough to preserve chemical bonds in their photospheres. Once molecules exist, they absorb photons in bands rather than single lines — each molecular vibration or rotation can accept a continuous range of photon energies, and the absorption spreads into wide brushstrokes.

  • TiO (titanium oxide) — the signature of M stars. Wide troughs near 705, 670, and 620 nm. Turns M-giant spectra into orange-and-black rainbows with no orange left.
  • C₂ (diatomic carbon) and CN — the carbon stars, where the photosphere holds more carbon than oxygen. Carbon steals all the oxygen into CO (which doesn't absorb in the visible), leaving none for TiO. The spectrum flips from TiO-dominated to C₂/CN-dominated. These stars look intensely red because blue photons get eaten by CN bands.
  • ZrO (zirconium oxide) — the elegant S stars, intermediate between M and C, where the carbon-to-oxygen ratio is almost exactly one. Zirconium from the star's own nuclear ashes floats up to the surface and claims the leftover oxygen.

An M or C star's spectrum tells you the stellar atmosphere is cool, convective, and churning freshly-fused elements up from the interior. That's why molecular spectroscopy was how astronomers first confirmed that AGB stars dredge nuclear ash to their surfaces — a cornerstone of stellar evolution and the heavy-element enrichment of the galaxy.

Try It Live on Every Star Page

Open any star you like on Nightbase — Vega, Betelgeuse, Arcturus, Capella — and expand the Stellar Absorption Spectrum panel under Explore. You'll see:

  • A Planck continuum coloured by the star's actual B−V colour index — blue for hot stars, deep red for M giants.
  • Labelled absorption dips for every major line the spectral class predicts: Hydrogen Balmer, Ca II H and K, Na D, Mg b, Fe I, He I/He II for hot stars, TiO/C₂/CN/ZrO for cool ones.
  • A legend of the six strongest elements for that star.
  • Hover the canvas — a tooltip tells you the wavelength, the flux, and the nearest absorption line with its strength as a percentage.

The simulator draws each line as a Gaussian dip whose depth and width depend on the star's spectral subclass. Drag Nightbase's spectral type from A0 to M5 (via the catalogue search) and watch hydrogen die while TiO is born. It is the O-B-A-F-G-K-M sequence on a single canvas — exactly what Payne explained, rendered in 60 frames per second.

A one-night spectroscopy tour

On any clear evening from northern latitudes, you can sweep three spectral classes without moving much:

Pull up each Nightbase page between targets. You will remember the O-B-A-F-G-K-M sequence for the rest of your life.

Spectroscopy is the thread that runs through almost every article on this site. The Hertzsprung-Russell diagram plots stars by luminosity and spectral class. Nuclear fusion in stars explains why the Sun's core produces a G-type spectrum. The life of stars is basically a trip along the O-M sequence as a star ages. Reading a spectrum is the skeleton key to all of it.

Test Yourself

Q1 Why are hydrogen Balmer lines strongest in A-type stars like Vega, and not in hotter stars like Spica?

Balmer absorption requires the electron to already be on the second energy level (n = 2), so a photon can kick it higher. At B-star temperatures (~25,000 K), hydrogen is mostly ionised — the electron is stripped off entirely, and an electron-less hydrogen nucleus can't absorb a Balmer photon. At A-star temperatures (~9,500 K), thermal collisions keep most electrons sitting on n = 2, ready to absorb. Too hot → no electron; too cold → electron in the ground state absorbing only ultraviolet. A stars are the Goldilocks window.

Q2 If every star in the galaxy is roughly three-quarters hydrogen and one-quarter helium, why do their spectra look so different?

Because temperature, not composition, controls which atoms are in which ionisation states and which energy levels. Hot stars show helium lines because helium is excited and hydrogen is ionised. Cool stars show calcium and sodium because those metals are neutral and unionised at low temperature, while hydrogen is too cold to absorb in the visible. Same ingredients, different thermometers. Cecilia Payne proved this in 1925.

Q3 The spectrum of a carbon star (C-type) shows strong C₂ and CN bands but no TiO, even though TiO is obvious in a cool M star at the same temperature. Why?

A carbon star's photosphere contains more carbon than oxygen (C/O > 1). All the oxygen bonds with carbon to form CO, which has no strong visible absorption. With no oxygen left, the star can't make TiO. Meanwhile, the leftover carbon forms C₂ and CN, producing the strong molecular bands that give carbon stars their intense red colour. Compare Betelgeuse (TiO) with a catalogued carbon star on Nightbase and the flip is obvious.

Q4 In Nightbase's simulator, why does the continuum's colour shift from blue to deep red as you change a star from B to M?

The continuum is a Planck blackbody curve, and its peak wavelength depends on temperature via Wien's law: λ_peak ≈ 2898 μm·K / T. A 25,000 K B star peaks in the ultraviolet at ~116 nm (we only see the blue tail falling through the visible), so the visible spectrum is blue-dominated. A 3,000 K M star peaks around 970 nm (deep near-infrared), so the visible part of its spectrum is the much-fainter blue wing, and the red overwhelms. Same equation, same physics, different T.

Q5 You suspect a star you're looking at is an S-type (carbon-to-oxygen ratio near 1). What would you look for in its simulated spectrum to confirm it?

S-type stars show zirconium oxide (ZrO) bands, typically in the red. Since their C/O ratio is close to 1, there's just enough oxygen left over from CO formation to bond with leftover trace metals — zirconium being the most spectrally obvious. TiO bands are weak or absent (most oxygen is tied up in CO), and C₂/CN bands are also weak (carbon is likewise mostly in CO). Finding ZrO where you'd expect TiO is the fingerprint of S-type chemistry, and a direct look at freshly dredged-up nuclear ash from an AGB star's interior.

stellar-spectra spectroscopy stars astrophysics