Consider the strength of the H absorption line in the spectra of stars of various surface temperatures. This is the amount of light that is missing from the spectra because Hydrogen electrons have absorbed the photons and jumped from level 2 to level 4. How do you think the strength of H absorption varies with stellar surface temperature?
An absorbance or transmission spectrum is a measure of the electromagnetic radiation that a particular sample of chemicals absorb. When a chemical absorbs light energy, ground state electrons move into higher energy states like you stated above. The spectrum shows the particular wavelengths of light absorbed and the intensity with which they absorb the energy. When measuring chemicals containing various elements or mixtures of molecules, a variety of wavelengths are absorbed so the spectrum looks like curves with rounded peaks. When measuring the absorbance of a single element like hydrogen, the difference between the energy levels of the electrons is finite and uniform, so the spectrum consists of sharp lines corresponding to these exact energy values (hence the term line spectrum). If you assume that the concentration of hydrogen being measured is relatively uniform across the surface of the star, the temperature of the hydrogen will affect the absorbance spectrum by varying the intensity of the absorption. Higher temperatures will increase the intensity of the absorption while lower temperatures will decrease it. The reason is that higher temperatures will allow the higher energy states of the hydrogen electron to be more easily populated.