Final answer:
When light goes from one medium to another, its direction of refraction depends on the index of refraction of the two mediums involved.
Step-by-step explanation:
When light goes from air to water, it changes direction toward the perpendicular. This is because the index of refraction of water is greater than that of air. When light goes from water to glass, it also changes direction toward the perpendicular because the index of refraction of glass is greater than that of water. However, when light goes from glass to air, it changes direction away from the perpendicular because the index of refraction of air is greater than that of glass.