Absorption and emission in more detail Electrons in an atom can only have certain energies and can only absorb or emit photons with energies exactly equal to the differences between those energy levels. Therefore a gas that is hot enough to have excited electrons will emit a spectrum consisting only of certain wavelengths. The spectrum will uniquely identify what atoms are in the gas. We'll see a series of bright lines with no light in between. Similarly a cold gas between us and a source of continuous light will absorb only certain energies or wavelengths of light, again identifying what's in the gas.
Blackbody radiation Note that emission and absorption spectra come from thin gasses .
For dense gasses, solids, and liquids, the atoms and molecules are bound together so strongly they no longer emit in discrete lines, but emit a thermal continuum of radiation or blackbody radiation . We emit as blackbodies, stars, a bar of iron in a fire, etc. Objects emitting as blackbodies give off more energy per surface area as they get hotter. The peak wavelength of the blackbody energy distribution also depends on the temperature of the blackbody. The hotter the blackbody, the shorter the wavelength at which it peaks.