When a wave or light ray moves from one medium to another its speed changes. The direction of the ray may also change.
This property of waves is called refraction and commonly occurs with light rays.
A good example of refraction is when you see the bottom of a swimming pool. The light travels from the bottom of the pool, through the water, then through the air into your eye. The light travels in such a way that the pool often appears to be shallower than it really is.
A normal is a dotted line drawn perpendicular to the surface of the refracting material, at the point of entry of the light.
When light travels from air into a denser medium like water or glass, it will refract towards the normal.
When light travels from a denser medium into air, it will refract away from the normal.
As can be seen in the diagram the light ray changes direction as it enters and leaves the block.
In all ray diagrams, all angles of incidence and refraction are measured between the ray and the normal.