Here's why:
* Refraction: Prisms use refraction, the bending of light as it passes from one medium to another (in this case, from air into the prism and then back out into air).
* Dispersion: The amount of refraction depends on the wavelength of light. This means different colors of light bend at slightly different angles. Since white light is a mixture of all colors, a prism separates them, creating a rainbow effect.