The presence of contaminants in optical interfaces modifies their optical properties. In the presence of contaminants, the organization of the molecules within the medium is no longer the same for the interior and the surface. Such an interface becomes a region of some finite thickness in which there is a gradual change of physical properties. In this case, a step refractive index profile cannot be used to describe this region, as is generally used in refractometry. In general, the refractive index at a surface or an interface should be presented as a gradient. The profile of the refractive index distribution at an interface is defined by the physical-chemical properties of the base medium and the contaminant. From the thermodynamic models developed for interfaces, a refractive index distribution can be proposed. The description of the interface in terms of a refractive index profile allows the use of optical testing methods developed for the characterization of optical materials. In particular, geometrical and interferometric testing procedures can be used. Ray tracing is required become the analysis of interferograms and light distribution in the outcome of geometrical test relays on an a-priori knowledge of the optical path followed by light. In this work we propose refractive index distributions based on the thermodynamic potentials of typical interfaces. Making use of the mathematical forumlism based on Fermat's principle, the ray tracing equation associated to each case is presented. The information about these light trajectories is necessary to determine the thickness, concentration, as well as the type of contaminant in the contaminated region.