Most people know that passing white light through a prism will divide it into its component colors. The light will display a rainbow of colors from red through violet. Understanding why this occurs can enhance the natural beauty of a rainbow. This rainbow of colors is caused by two effects, refraction and dispersion.
When light travels from one medium into another medium, its path is bent; the light is refracted. The angle through which the light is refracted depends, according to Snell's law, on the indices of refraction of both the first and second media. The index of refraction of a medium is a property of the material that can be measured by laboratory experiments.
There is however one effect that causes the splitting into different colors. The index of refraction of a material is not a constant. The refractive index depends on the wavelength of the light. Light is an electromagnetic wave. Different colors of light are just electromagnetic waves with different wavelengths. Red light has a longer wavelength than blue or violet light.
The refractive index of material depends of the wavelength of the light. That means the light of the different colors of the rainbow: red, orange, yellow, green, blue, indigo, and violet (RoyGBiv) can have a different index of refraction in the same material.
When white light, containing all the colors of the rainbow, passes through a piece of glass such as a prism it is refracted. Because each color has a different index of refraction each color is refracted a different amount. The long wavelength red light refracts through a different angle than the short wavelength blue light. The intermediate wavelength colors refract through an intermediate angle.
Hence the refracted white light is split into its component colors. Physicists call this effect dispersion.
When light passes through a prism, it is refracted twice, when it enters the prism and when it leaves. During these two refractions, the different colors are refracted different amounts. This dispersion causes white light to split into its component colors. Hence we see a rainbow after light passes through a prism.
This dispersion is not always good. Think of a convex lens as a rounded prism. Just as dispersion happens when light passes through a prism, it can also happen when light passes through a lens. Dispersion can occur with either a concave or convex lens. However we usually don't want a lens to split the light into component colors. Think about a lens in a camera, pair of binoculars, or telescope. When a lens in such an optical instrument disperses light into component colors, the lens will focus light of different colors at different positions. Optical physicists call this chromatic aberration. High quality optical instruments must use multiple lenses designed to reduce chromatic aberration.
Everyone's favorite example of dispersion is a rainbow. To cause a rainbow, light enters water droplets. It is refracted, totally internally reflected off the back, and refracted again as it leaves. The refractions cause the dispersion effect and we see a rainbow.
When light refracts, different colors refract through different angles. This dispersion effect produces a rainbow of color.
Wilson, J.D., Buffa, A.J., and Lou, B., College Physics 6th ed., Pearson, 2007.
Knight, R.D., Physics for Scientists and Engineers with Modern Physics, Pearson, 2004.