The Fraunhofer Spectrum
There are three kinds of spectra you should know about.
Continuous - All the colours, i.e. wavelengths, of the visible spectrum with nothing missing. What we see when white light is dispersed by a prism.
Emission - When atoms are excited they give off light. Different elements produce light with very definite wavelengths, i.e. very definite colours. Sodium lamps are yellow because sodium emits lots of yellow light. Neon lights are red because neon atoms emit lots of red and orange light. Mercury emits lots of blue and green light. Think of it as a fingerprint or a bar code. If we can measure the wavelength of the light given off by a substance we can identify it. Here is the visible part of the emission spectrum for hydrogen.
Absorption - If white light, containing all the colours, passes through a gas then when it emerges some of the colours are missing. This is because the atoms in the gas absorb light with very definite wavelengths, actually exactly the same wavelengths that the same atoms would emit if they were excited. What we see is a continuous spectrum with black lines on it. Here is an absorption spectrum for hydrogen. Notice what colours are missing.
If we pass sunlight through a prism we see the visible spectrum we expect but also many black lines. It is called the Fraunhofer spectrum after one of the first people to study it. Below is a German stamp featuring Fraunhofer's original drawing.
This is of course an absorption spectrum. The black lines, over 600 of them, are due to the absorption of particular wavelengths of light by chemical elements in the outer layers of the Sun. This means that if we measure the wavelength of these black lines we can identify what elements there actually are in the Sun. Their relative intensity also tells us how much of these elements are present and so we can build up a pretty good picture of what the Sun is made of.
One set of lines, including a strong yellow line, did not correspond to any known element. In 1870 Lockyer suggested that they corresponded to a new element which he named Helium after the Greek Sun god Helios. 25 years later Helium was discovered on Earth.