A ray of light bends when it travels from one medium to another due to the change in the speed of light.