Reflection and refraction (transmission) of light
Here a ray of light in air meets the interface with glass. Part of the incident energy is reflected and part is refracted. What do we expect for the phases here?
The refractive index for air is very nearly 1. That for glass is somewhat higher: n ~ 1.5 here. (See Geometrical optics for an introduciton.) So the speed of light in glass (by definition c/n) is slower than that in air. Glass is analogous to the heavy string in the clips above.
So, going from air towards glass (low n towards high n), we expect light to be reflected with a phase change of π. Going from glass towards air, we expect reflection with a phase change of zero. And, in both cases, the transmitted wave has a phase change of zero.
(Although we don't show it here, we also get these predictions for the phases by imposing the boundary conditions on the electric field and displacment at the interface: the speed of light is slower in glass because its dielectric permettivity is higher.)
Before we test these predictions, let's look at the wave behaviour in the following animations.