A method for solving physical problems is suggested in which the general solution of a differential equation in partial derivatives is written in the form of decomposition in spherical harmonics with indefinite coefficients. Values of these coefficients are determined from a comparison of the decomposition with a solution obtained for any simplest particular case of the examined problem. The efficiency of the method is demonstrated on an example of calculation of electromagnetic fields generated by a current-carrying circular wire. The formulas obtained can be used to analyze paths in the near-field magnetic (magnetically inductive) communication systems working in moderately conductive media, for example, in sea water.