A nonsequential ray tracing method is described for treating systems where the order in which surfaces are hit depends on the ray being traced. These include systems with segmented mirrors and/or apertures, various types of prisms, e.g. corner cube reflectors and roof prisms, and systems containing concentrating collectors, waveguides, and resonators. Nonsequential (NS) surfaces are entered in any order using global coordinates, and can be nested with sequential surface subsystems. The material on both sides of each surface must be specified, as well as the refractive mode (i.e., whether a ray is to reflect, refract, or do either depending on whether or not the ray satisfies the conditions for total internal reflection). Analyses of selected systems using the Code VTM optical design program are presented as examples of this technique.