A light ray incident on a rectangular glass slab immersed in any medium emerges parallel to itself because the extent of bending of the ray of light at the opposite parallel faces AB (air-glass interface) and CD (glass-air interface) of the rectangular glass slab is equal and opposite. The light ray suffers a lateral shift.