Light travels at different speeds in different medium. In space where there is vacuum, light travels at a very high speed. It moves little bit slower through an area filled with matter. While travelling from one medium to another, it changes speed before it takes a turn. The refraction (bending of light) occurs only at the boundary. Once the light has crossed the boundary between the two media, it continues to travel in a straight line. It is this refraction that fools our eyes making objects look different from their original form.
One such example is when we look at a spoon partially immersed in a glass of water. The spoon appears slightly bent where it enters the water. This is due to the bending of light when it travels from water medium into air medium. There is a constant called ‘refractive index’ of the medium which determines how light bends. Air has a refractive index of about 1.0003 while water has a refractive index of about 1.33.