The speed at which light propagates through a medium is dependent upon the wavelength of the light. As light passes from a rare to a dense medium, the shorter wavelengths of the visible spectrum at the blue end are slowed to a greater extent than the longer wavelengths at the red end. The refractive index therefore varies with wavelength and the various wavelengths (colours) are refracted (deflected) by different amounts.
The image on the left shows a ray of white light passing through a prism. The range of refractive indices results in a different angle of refraction for each wavelength of light and hence the spatial separation of the white light into its component colours. This process is known as dispersion or chromatic dispersion, and media that give rise to the phenomenon are known as dispersive media.