Whenever light rays hit the boundary of a new medium, the rays behave according toSnell's Law. Snell's Law states that the angle of incidence is equal to the angle of refraction. This means that if a ray of light hits the boundary of a lens at 90 degrees, then the same ray will be reflected at an equivalent angle of 90 degrees. This also means that if a ray of light hits the boundary of a new medium perpendicular to the boundary’s axis, it will continue to travel in the same direction.
Refraction occurs when a ray of light hits the boundary of a new medium at an angle. This is because one of the parallel rays will contact the boundary before the other and therefore causing their velocities to differ. For a fraction of time, one of the parallel rays will be traveling faster than the other, causing the light rays to appear to bend in the direction of the slower beam - this is how refraction occurs.