A hydrogen atom can absorb a Balmer photon only if its electron already sits in level $n = 2$ (see Hydrogen's Spectral Series). So the strength of the Balmer lines in a star's spectrum depends on how many hydrogen atoms in its atmosphere are in $n = 2$. Temperature sets that number, and the rule that sets it is one of the most useful in all of physics.
💡 Why it works
In a gas at temperature $T$, atoms constantly trade energy in collisions. Statistical physics shows that in equilibrium the chance of finding an atom in a particular state of energy $E$ is proportional to the Boltzmann factor $e^{-E/kT}$: each extra $kT$ of energy makes a state $e \approx 2.7$ times less likely. A level can also contain several states with the same energy; its statistical weight $g$ counts them. For hydrogen, level $n$ has $n^2$ orbital states, each with two spin states, so $g_n = 2n^2$.
🔑 Key idea
The Boltzmann equation: $$\frac{N_b}{N_a} = \frac{g_b}{g_a}\,e^{-(E_b - E_a)/kT}.$$ For hydrogen, $N_2/N_1 = 4\,e^{-10.2\text{ eV}/kT}$, with $k = 8.617 \times 10^{-5}$ eV/K.
The Balmer lines all start from level $n = 2$, 10.2 eV above the ground state.
Worked examples
✏️ Worked example: The Sun's atmosphere
Find $N_2/N_1$ for hydrogen at the Sun's $T = 5772$ K.
Answer: About $2.9 \times 10^{-5}$: almost 6,000 times more than in the Sun, though still a small fraction.
✏️ Worked example: When would the levels be equally full?
At what temperature would $N_2 = N_1$?
$1 = 4e^{-10.2/kT}$, so $10.2/kT = \ln 4 = 1.386$.
$T = 10.2/(8.617 \times 10^{-5} \times 1.386) \approx 85{,}000$ K.
Answer: About 85,000 K. Long before that, the hydrogen is ionized, as the next topic shows.
The fraction of all hydrogen atoms in level $n = 2$. Excitation (Boltzmann) pushes it up; ionization (the Saha equation) pulls it down. It peaks near 9,000 to 10,000 K.
⚠️ Common mistake
Expecting the hottest stars to show the strongest hydrogen lines, because the Boltzmann factor keeps growing with temperature. It does, but above about 10,000 K most hydrogen atoms lose their electron entirely, and an ionized atom cannot absorb a Balmer photon. The two effects together make the $n = 2$ population, and the Balmer lines, peak in A stars near 9,500 K. Check: Vega (an A star) shows far stronger Balmer lines than the much hotter O stars.
Practice
Pass with 3 right answers, the last 2 in a row. Each right answer earns 3 XP.