If you pass light though a prism it is dispersed into its constituent colours. this is becase the degree of refraction that a wavelength of light undergoes depends upon its frequency. The higher the frequency the more it refracted. Therefore blue light is refracted more than red light.
White light is made up of a spectrum (range of wave frequencies). This can be dispersed by a prism to show us all of the colours present in white light.
A favourite examination question is to ask you to complete a diagram such as the one above.
Just learning it is not enough though... you should understand that only light that went into the prism can come out of the other side. Therefore if only red light goes in - only red can come out!
If pure yellow light goes in only pure yellow (single wavelength yellow - such as is found in a sodium light source) will come out - but if yellow light made up of red and green goes in, then the red and green will separate.
You must have the light bend the correct way at each optical bounday and you must have the degree to which they bend correct too.
Therefore you should know the primary and secondary colours of light and the colours that make up white light: red, orange, yellow, green, blue, indigo, violet.
is the 'mnemonic' many use to help them remember this.
Click here to visit a page that combines dispersion with the use of coloured filters.
This video very clearly explains how it is that we see a rainbow in the sky: