.
Water waves travel slower in shallow water than in deep. This is why waves break. The bottom of the waves slows down as the water becomes shallower up the beach. The top of the wave continues at its original speed and so 'falls' forward.
If we consider light then the media could be air and glass. The light travels slower in the glass than in air. When a ray of light enters a glass block at an angle to the interface (edge) it is bent away from the normal. When rays leave a glass block they bend towards the normal. We have seen that the bigger the angle of incidence then the the ray is refracted (bent).
Diffraction
When a wave moves through a , or past an obstacle, it from the edges. This is diffraction.