The bending of the light when it changes media is called a refraction. The wave bend as it enters the medium at a very different speed, that way, it will be seeming to look like the light is being bent by something, when in fact, the wave just goes through transitions from a fast medium to a slower one.