Now imagine that the angle of incident ray from the denser medium increases. The ray will come out at larger and larger angles from the norma, in the rarer medium. At a certain critical angle, the outcoming ray will come on a grazing angle, it will be almost parallel to the surface between denser and rarer medium. And then, for larger angles, no rays come out, they are totally internally reflected!!
What a fantastic phenomenon... Its responcible for rainbows... the light rays get totally internally reflected inside the sphere of water before coming out, and get dispersed in the process. Check out this cool video showing how after certain angle, the laser light is totally internally reflected: - Youtube Video.
Another magician's trick can be explained. Suppose a magician pours water in a glass containing a coin, and the coin disappears! :) How it happens is seen in this video.
This fact of reflection of light is put to a great use in transport of light through small tubes. This way of reflecting the light is total, there is no transmission loss. Here is a nice video of Harvard Professor explaining this.
In the following image you see the Total Internal Reflection of the image of the turtle!
When you look closely at what is happening, certain questions popup in your mind. After all, light behaves as wave also, and even in its particle nature, how is it that a photon would know, whether it has to get totally internally reflected, or just come out of the surface!
What actually happens is something like this: the light waves inside the denser medium are sinusoidal. When they reach the surface interface, they sample the space outside, in terms of exponentially decaying fields. If the material is not dense enough, they return back!
To taste the validity of propogation of fields into so called "Classically forbidden" region, we can do an experiment. We can keep a denser medium after a gap of rarer medium. Voila! Its found that the wave has propogated into the denser medium inspite of the gap! This is called quantum tunnelling or frustrated total internal reflection.