Light does not have to travel in a straight line. In fact, when light passes from one medium to another, it may bend away from its usual path. Well, you may know about this phenomenon - It is Refraction. "Refraction is the change in direction of a wave due to a change in its transmission medium." That is a boring definition.
Let us Discover Physics: Appreciating Nature