In this section, we will discuss the refraction of light with an example.
As light passes through a given medium, it progresses in a straight line. But, when light travels from one medium into another medium, the light path bends. Refraction takes place.
The refraction happens only at the boundary. Once the light has passed the boundary between the two media, it travels in a straight line. Now, only the direction of that line is distinct than it was in the previous medium. Whenever sighting at an object, light from that object shifts media on the way to your eye; a visual distortion is expected to happen.
We can explain this visual distortion with an example.
Consider a pencil is submerged in a glass half-filled with water. In this case, that pencil appears to be displaced while partially submerged in water.
Refraction of light effects
As you see through the side of the glass at the part of the pencil located above the surface of the water, light progresses directly from the pencil to your eye. Since this light does not change the medium, it will not get refracted. (There is a change of medium from air to glass and again back into the air. Because the glass is thin and the light starts and is finished in air, the refraction into and out of the glass causes slight deviation in the light's original direction.)
As you see at the portion of the pencil submerged in the water, light passes from the medium water to air (or from water to glass to air). This light ray changes medium and afterwards experiences refraction. Because of that, the image of the pencil seems to be broken. Furthermore, the part of the pencil submerged in water seems to be broader than the part of the pencil that is not submerged. The refraction of light describes these visual distortions.