We describe a novel approach to refractive-index reconstruction in two-dimensional systems with no special symmetry, based on observation of traces of rays that travel through the optical system. The mathematical model of ray-tracing analysis is presented in detail, and both the analytical and numerical solutions are given. Methods of data processing in the presence of experimental errors are developed and applied to model problems.