The paper gives a systematic presentation of the Wigner function method (Weyl formalism) for modeling the propagation and absorption of electromagnetic waves in anisotropic and gyrotropic dissipative media with spatial dispersion. A general kinetic equation for the Wigner function (tensor) is formulated, and its asymptotic expansion up to the second order for smoothly inhomogeneous and weakly dissipative media is constructed. As a result, a modification of the method of the kinetic equation for rays is proposed, based on the stochastic description of rays, making it possible to increase the accuracy of numerical modeling of wave problems with strong transverse inhomogeneity of the absorption coefficient without increasing the amount of calculations. The technique developed can be used to describe the propagation, absorption, and scattering of electron-cyclotron waves in high-temperature plasma of magnetic traps for controlled fusion in cases where standard modeling methods do not provide the necessary accuracy.