When a wave slows down or speeds up due to travelling in a more or less dense medium.
When a wave enters a more dense medium it will slow down and bend towards the normal (see diagram). When a wave enters a less dense medium it will speed up and bend away from the normal.