English: This is a
conceptual animation of the
dispersion of light as it travels through a
triangular prism.
In vacuum (shown in black), light of any wavelength will travel at a fixed speed, c. But light slows down in a different medium (such as glass or water), and light of shorter wavelengths (like indigo) will tend to travel slower than light of longer wavelengths (like red)
This model attempts to convey this fact and its consequences by idealizing light as small particles travelling in space. Of course, light is not made of small particles but of electromagnetic waves, so keep in mind this conceptual aspect of the image to avoid any misconceptions about the nature of light itself. For our purposes, however, the model will suffice.
White light, represented here by white dots, is actually made out of light of several frequencies (colors) travelling together. These basic frequencies of visible light are part of what we call visible spectrum, and it is only tiny part of the entire electromagnetic spectrum.
As white light enters a medium (in this case, the prism), each of its composing wavelengths will travel at a different speed in the new medium, and this change in speed is what bends the path in which light is travelling. This is the phenomenon we call refraction. The ratio between the speed of light in vacuum and the speed of light in a medium is what we call index of refraction, and this value is specific for a given wavelength and medium.
Since light of different wavelengths will change direction by a different amount, we will experience a division of white light in its composing spectral colors, represented here by colored dots. This is what we call dispersion.
Once the basic frequencies are separated in this animation, we can easily see the difference on their speeds. Red, with a long wavelength, passes through almost without any change, whereas indigo (with short wavelength) is left behind by all the other colors. However, this difference in speed does not hold in vacuum, and this can be seen on how all light exiting the prism will once again travel at the constant speed of light in vacuum.
This is all just an easy way of seeing it, so it is important to stress once again the fact that this model is not entirely accurate, as light is not made of little round particles, and white light can't exist on its own (as can be misunderstood from the big white dots).