Here's why:
* Refractive index: The angle of refraction is determined by the refractive index of the medium. The refractive index is the ratio of the speed of light in a vacuum to the speed of light in the medium.
* Wavelength and refractive index: The refractive index of a material is not constant but varies slightly with the wavelength of light. This means different colors (wavelengths) of light will bend at slightly different angles when entering a medium.
* Dispersion: This variation in the refractive index with wavelength leads to the phenomenon of dispersion. When white light (containing all colors) enters a prism, for example, the different colors are refracted at different angles, separating the light into its constituent colors.
In summary:
* Longer wavelengths (red light) have a lower refractive index and bend less.
* Shorter wavelengths (blue light) have a higher refractive index and bend more.
This is why we see a rainbow after a rainstorm, and why prisms can separate white light into its colors.