When light travels from a rarer (less dense) medium to a denser medium, such as from air to water or from air to glass, there is a change in its speed. This change in speed causes a phenomenon known as refraction. The wavelength of light changes as it undergoes refraction, while the frequency remains constant.
According to Snell's law, which describes the behavior of light at the interface between two different media, the ratio of the sine of the angle of incidence to the sine of the angle of refraction is equal to the ratio of the velocities of light in the two media. Mathematically, it can be expressed as:
n₁sin(θ₁) = n₂sin(θ₂)
where n₁ and n₂ are the refractive indices of the initial (rarer) and final (denser) media, respectively, θ₁ is the angle of incidence, and θ₂ is the angle of refraction.
Since the speed of light in a denser medium is slower than in a rarer medium, the refractive index of the denser medium is higher. As a result, when light passes from a rarer to a denser medium, it bends towards the normal (an imaginary line perpendicular to the surface separating the two media). This bending causes a decrease in the angle of refraction compared to the angle of incidence.
The change in direction of the light wave due to refraction affects the effective path length traveled by the wave. This alteration in path length leads to a change in the wavelength of the light, while the frequency remains the same. In general, when light enters a denser medium, its wavelength decreases.
To summarize, when light travels from a rarer to a denser medium, its wavelength decreases due to the phenomenon of refraction.