A method is presented for calculating graded-index profiles from phase information obtained with the help of the recently proposed Lloyd's mirage experiment. It is based on an exact solution of the inverse scattering problem in the ray (WKB) approximation. An analytical example is given for illustration.