When light waves move from air into glass, the corner of the wavefronts closer to the glass slow down first. This causes those parts of the wavefronts to get closer together meaning their wavelength decreases. This causes the waves to change direction towards the normal. As wave passes back to the less dense material the corner of the wavefront closest to the glass speeds up, this causes the wavelength to increase and causes it to refract away from the normal.