According to Snell's Law, when light travels from a rarer medium (like air) to a denser medium (like glass), the ray bends towards the normal. When it travels from a denser medium to a rarer medium, it bends away from the normal. For a prism, the incident ray bends towards the normal at the first surface and the emergent ray bends away from the normal at the second surface. The net deviation of the ray is always towards the base of the prism for a ray entering one face and exiting another.