(You can read all the mathematical details of ray tracing in Turner Whitted's groundbreaking paper "An improved illumination model for shaded display", in Communications of the ACM, Volume 23, Issue 6.)
Ray tracing can produce realistic scenes but it is very slow. This is acceptable for producing computer generated movies, but becomes a problem when you need lighting to change in real-time, such as in computer games. Complex phenomena such as shadows, caustics and multiple reflections are hard to model dynamically and more sophisticated mathematical methods, for example precomputed radiance transfer and radiosity are used here.