why a change in speed of light causes refraction of light