How and why is the spectrum of a star related to its surface temperature?
Good question! The spectrum of a star is related to its surface temperature in at least two ways, (i) through its overall colour, changing from “red” to “blue,” etc. as it gets hotter, and (ii) the particular pattern of “spectral lines” observed in its own spectrum. The presence of particular lines, and their strength, reflect both the abundance of the element making such lines in the star’s surface regions, and the temperature there. That’s a very short answer; a much longer answer (not for the faint-hearted!) follows To go further, and delve into many more details, we first need a few preliminaries. Preliminaries: 1. The surfaces of stars have an “effective temperature,” T_eff, related to how big the star is and how much energy is coming from below to be radiated away. Ignoring the technical definition of that, let’s simply say that the physical temperature T at the surface layer where the average photon has a 50-50 chance of making it out into space is close to this idealized T_eff.