The law for the refraction of a wave when the two fluids and the interface are moving with relativistic velocities is given in an exact form, at the same time correcting a first order error in a previous paper [Cavalleri and Tonni, Phys. Rev. E 57, 3478 (1998)]. The treatment is then extended to a generally moving fluid with variable refractive index, ready to be applied to the refraction of acoustic, electromagnetic, or magnetohydrodynamic waves in the atmosphere of rapidly rotating stars. In the particular case of a gas cloud receding because of the universe expansion, our result can be applied to predict observable micro- and mesolensings. The first order approximation of our exact result for the deviation due to refraction of the light coming from a further quasar has a relativistic dependence equal to the one obtained by Einsteins' linearized theory of gravitation.