Studying the line spectra produced by hot gases and absorbed by cooler gases allows us to identify the elements in stars. When a gas is very hot, it doesn’t emit all wavelengths of light.