Typically, superheated solids and liquids will emit light of all colors. We see it as white light but if we use a spectroscope or prism to separate the light by different frequencies, we see it as a spectrum like the one to the left. So if we shine white light through a gas then view it with a spectroscope we find that there are some colors missing. These missing colors are the colors that were absorbed by the gas as the light passed through it.
Different atoms absorb different colors.
This technique is used to identify what the outer layers of stars are made of. Notice the position and colors of the absorption spectrum line up with those of the emission spectrum. This means that the colors of light emitted by an atom are the same colors that can be absorbed by that atom. As a result of the Doppler effect, if a mass of excited atoms are moving away from us then the wavelengths will become longer making all the colors shift slightly toward the red side of the spectrum. We call this the Red Shift.