Snell's Law Interactive - with Total Internal Reflection!
Note that when the angle of refraction would exceed 90 degrees, the beam is not refracted, and is instead totally reflected inside the denser medium.
Click http://interactagram.com/physics/optics/refraction/ link to open resource.