The propagation of partially coherent beam in refractive media (linear or nonlinear) obeys the equation for the second order coherence function. Numerical solution of this equation is encountered with difficulties, because this equation is in five independent variables. A ray method for solving this task is constructed. The advantage of this approach is that partial differential equation reduces to the set of ordinary differential equations similar to the geometric optics equations. But there are no divergences in the present method due to the presence of diffractive term in the ray equation. The accuracy of this method is discussed. It is shown that propagation of the coherent beam is exactly described by this technique. Based on the solutions obtained with this technique a comparison of self-action of a coherent and partially coherent beams with the same Fresnel number is made. Relations of this technique to the ray methods of solving small angle radiation transfer equation are discussed.