Refraction occurs when light changes speed as it passes from one medium to another, causing the light's path to bend. The ratio of the sines of the incident and refracted angles is a constant called the refractive index, which depends on the densities of the media. Total internal reflection occurs when light travels from a denser to a less dense medium at an angle greater than the critical angle, causing all the light to reflect within the denser medium.