Light entering a prism is dispersed due to differences in how much each wavelength of light is refracted. The red color of light has the longest wavelength and is refracted the least, so it deviates the minimum amount when passing through a prism. The different colors of light spread out as they exit the prism due to their varying degrees of refraction.