When light hits the glass wall of the prism it changes speed (slows down) ever so slightly which causes its direction of motion to be changed just slightly. The amount of the change depends on the colour of the light, so this spreads the light out into a rainbow.
Comments