If light is traveling through air, it slows down and ends up bending. But how? If I'm running straight, and I get slowed down, shouldn't I still be running straight?
If I'm running straight, and I get slowed down, shouldn't I still be running straight?
but suppose one foot get slowed down while the other one didn't. In that case you would turn in the direction of the foot that was slowed down. This is analogous to (though not exactly the same as) what happens when light is refracted. If light hits a refractive index boundary head on, i.e. $i = r = 0$, then it is not bent. The change in the angle occurs when the light hits a refractive index boundary at an angle greater than 0, so one side of the wavefront is slowed down first.
To augment Rennie's answer with a graphical representation let me post this diagram:
Imagine, if you will, not a single beam of light but a series of wavefronts. When part of the wavefront slows due to a different density, the wavelength also compresses, thus introducing the characteristic bend.