Ray tracing, the process of finding the distance through the various layers of shielding material in a reactor compartment, is a basic operation of both point-kernel and Monte Carlo computer programs. Interdependent shield-definition and ray-tracing algorithms have been developed that allow the components of a reactor to be described as individual shield units in a geometrically convenient manner and with one-, two-, or three-dimensional material variation. Rectangular, cylindrical, and spherical geometries are allowed. These shield units may be combined using a recursive embedding technique; the cells formed by the coordinate surfaces describing a shield unit may be filled either by material compositions or by cell-shaped portions of subsidiary shield units, to many levels of recursion. Ray tracing through such a shield array proceeds from coordinate surface to coordinate surface. Distances are calculated by explicit formulas in each of the three permitted geometries.