A perturbation method similar to those adopted in the many-body problems and the corresponding diagram technique are proposed for systems of spins interacting individually with each other and/or with other degrees of freedom. A generalization of Wick's theorem is introduced and illustrated by simple examples. By using this new method, the ESR spectra of magnetic impurities in metals are discussed. It is shown that shift and broadening of the resonance spectra are related to the dynamical susceptibilities of the pure host metals and that the effect of conduction electron spin relaxations on the impurity ESR spectra can be handled neatly by assuming an appropriate form for the expression of the dynamical susceptibilities.