In this work, we show that the orthogonality between rays and fronts of light propagation in a medium is expressed in terms of a suitable metric contact structure of the optical medium without boundaries. Moreover, we show that considering interfaces (modeled as boundaries), orthogonality is no longer fulfilled, leading to optical aberrations and, in some cases, total internal reflection. We present some illustrative examples of this latter point.