what happens to the direction of a light wave when it passes from a less dense medium such as air into a more dense medium such as glass