Why does a ray of light bend when it travels from one medium to another?

Due to the change in the speed of light.


18