The Optics of Rays, Wavefronts, and Caustics