Refraction
Refraction occurs when a wave enters a medium of different density, e.g from air to glass.
When the wave enters a denser medium as in a the animation from R1 to R2, this property of the medium is called the Refractive Index.
The wave length becomes shorter and the wave speed decreases. The Frequency Remains the same.
Snell's Law
When a wave enters a medium at an angle, within the medium the angle of direction will change depending on the Refractive Index.
If the wave speed of the medium entered V2 is less than the inital medium wave speed V1 the wave will bend towards the Normal. The angle and the wave speeds are related as shown in the equation below.