In physics, refraction is the change in direction of a wave passing from one medium to another or from a gradual change in the medium with a different refractive index (\(n\)). In optics, the refractive index or index of refraction of a material is a dimensionless number that describes how fast light travels through the material. This index is defined as equal to 1 in a vacuum. For any other medium, it is defined as the speed of light in a vacuum \(c\) divided by the speed of light in the medium \(v\) (phase velocity of light in the medium).
Thus refraction occurs when the speed of light is different in the two media. The amount by which rays of light change direction depends on the media involved and the frequency of the light.