We derive an expression for the mutual coherence function for a lasing medium with spatially varying refraction and gain using a ray-tracing (WKB) formalism. The expression is valid in the limit of large refractive Fresnel number, which is equal to the geometric Fresnel number multiplied by the ratio of laser length to refraction scale length. For quasihomogeneous sources, the coherence function has the form of a Fourier transform of a source function which is modulated by a Gaussian whose width varies inversely with the square root of the gain. This result may be viewed as a generalization of the van Cittert -Zernike theorem to include both refraction and gain. For the case of refractive defocusing, we find the coherence length scales as the square root of the product of gain and the refraction scale length, inversely with the refractive Fresnel number, and exponentially with laser length. For a parabolic profile, this result is exact. We also treat hyperbolic secant refractive and gain profiles. Comparison of our results with numerical computations shows good agreement. We also indicate how to generalize the method to nonideal profiles obtained from measurements or hydrodynamic simulations.PACS number(s): 42.55.Vc, 42.50.Ar