The relation between the angle of incidence and the angle of refraction is known as Snell's Law. Since the light travels with different speed in different media, the direction of the ray of light will change when it crosses the boundary between the two media