Even the nearest star beyond the Sun is more than four light-years away. No probe has reached one, and none will in your lifetime. That leaves astronomers with exactly one thing to work with: the light that reaches our telescopes. The trick is not to just look at that light, but to take it apart.
Send starlight through a prism or a diffraction grating and it fans out by wavelength into a spectrum — violet at the short-wavelength end (around 400 nanometers), red at the long end (around 700 nm). Beyond violet is ultraviolet; beyond red is infrared. Our eyes only see the thin middle slice, but a star shines across all of it, and every part carries information.
A star's spectrum answers two big questions at once: how hot is it? (read from the overall shape and color) and what is it made of? (read from the thin dark lines crossing it). The rest of this page takes those one at a time.
Any hot, dense object — a stove burner, a lightbulb filament, the glowing surface of a star — gives off light across a smooth range of wavelengths. Physicists call an ideal version of this a blackbody, and stars behave very much like one. The important part: the shape of that glow is set almost entirely by temperature.
Every blackbody's output rises to a peak and falls off again. As the object gets hotter, that peak slides toward shorter wavelengths. This is Wien's law:
Double the temperature and the peak wavelength is cut in half. The Sun's surface, at about 5,800 K, peaks near 500 nm. A cool 3,000 K star peaks near 1,000 nm, out in the infrared, so what we do see of it is mostly red. A 30,000 K star peaks near 100 nm, deep in the ultraviolet, and its visible light is dominated by blue.
Drag the temperature. Watch the star's color and where its light peaks — the curve's peak slides toward shorter wavelengths as the star heats up.
Each curve is scaled to fit the box. In reality, a hotter star gives off far more light at every wavelength, not just a different mix.
And there's a second payoff: a hotter star doesn't just shift its color — it emits more energy at every wavelength. Temperature controls both the color and how much light pours off each square meter of the star's surface. That will matter a lot in Activity 4.1.2.
Look closely at a star's spectrum and the rainbow isn't smooth — it's crossed by thin dark gaps called absorption lines. In the 1800s, Gustav Kirchhoff worked out that there are three basic kinds of spectra, and which one you see depends on what the light passes through:
| Spectrum | What makes it | What it looks like |
|---|---|---|
| Continuous | A hot, dense object (a filament, a star's inner layers) | An unbroken rainbow |
| Emission | A hot, thin gas on its own | Bright colored lines on a dark background |
| Absorption | Cooler gas in front of a hotter light source | A rainbow crossed by dark lines |
A star is a hot, dense interior wrapped in a thinner, slightly cooler atmosphere — exactly the recipe for an absorption spectrum. So where do the lines come from? Electrons in an atom can only sit at certain energy levels, like rungs on a ladder. An electron can absorb a photon only if that photon carries exactly the energy needed to jump from one rung to another — which means only very specific wavelengths get absorbed.
Astronomers identify elements in a star by matching its dark lines against lab spectra of known elements. A match has to be the whole pattern, not one line: sodium always shows its close pair near 589 nm, hydrogen always shows its set at 656, 486, 434, and 410 nm. This method was so powerful that helium was discovered in the Sun's spectrum in 1868 — decades before anyone found it on Earth. Its name comes from helios, Greek for Sun.
The top strip is a mystery star. Pick an element to lay its lab spectrum underneath. If every one of its bright lines lines up with a dark line in the star, that element is there.
In the early 1900s, a team at Harvard sorted the spectra of hundreds of thousands of stars. Annie Jump Cannon built the system still used today: seven spectral classes arranged from hottest to coolest —
The letters look scrambled because the classes were first named alphabetically by how strong their hydrogen lines were, then reordered once astronomers realized temperature was the real pattern. Generations of students have remembered the order with "Oh Be A Fine Girl/Guy, Kiss Me." Each class splits into subclasses 0–9, with 0 the hottest. The Sun is a G2 star.
Click a class. The bars show how strong the hydrogen lines are in each class — watch where they peak.
Notice the hydrogen bars: they peak at class A and fade in both directions. That's a temperature effect. Visible hydrogen lines need electrons sitting on the second rung of the ladder. In a cool M star, almost every electron is stuck on the bottom rung. In a blazing O star, most hydrogen is ionized — its electron knocked off entirely — so there's nothing left to absorb. Around 10,000 K is the sweet spot.
Put it all together and you have a repeatable routine for any star — including the unnamed one waiting for you in Problem 4.3.1:
| Step | Look at | What it tells you |
|---|---|---|
| 1 · Shape | Where the light peaks; the overall color | Surface temperature (Wien's law) |
| 2 · Lines | Which dark lines appear, matched to lab spectra | Which elements are in the atmosphere |
| 3 · Pattern | Which lines are strong vs. weak (ionized helium? strong hydrogen? molecules?) | Spectral class — and a cross-check on temperature |
| 4 · Sanity check | Do steps 1 and 3 agree? | If a "red" star shows ionized helium, something's off — look again |
Try it on Betelgeuse and Rigel, the two brightest stars in Orion. Betelgeuse glows red-orange, peaks in the infrared, and shows molecular bands: a cool M star. Rigel is blue-white, peaks in the ultraviolet, and shows helium and hydrogen: a hot B star. Same constellation, opposite ends of the scale — and you can see the difference with your own eyes on a clear winter night.