Light travels in straight lines. When light rays pass into a different medium, the speed of the light ray changes. Light travels slowest in dense mediums. When a light ray enters glass having previously travelled through air, the speed of the wave decreases. This is because glass is denser than air. A ray of light refracts towards the normal when it slows down and away from the normal when it speeds up. The greater the change in speed, the more the ray deviates (changes) from its original path.