  The Lifshitz formula is derived by making use of the spectral summation
method which is a mathematically rigorous simultaneous application of both the
mode-by-mode summation technique and scattering formalism. The contributions to
the Casimir energy of electromagnetic excitations of different types (surface
modes, waveguide modes, and photonic modes) are clearly retraced. A correct
transition to imaginary frequencies is accomplished with allowance for all the
peculiarities of the frequency equations and pertinent scattering data in the
complex $\omega $ plane, including, in particular, the cuts connecting the
branch points and complex roots of the frequency equations (quasi-normal
modes). The principal novelty of our approach is a special choice of
appropriate passes in the contour integrals, which are used for transition to
imaginary frequencies. As a result, the long standing problem of cuts in the
complex $\omega $ plane is solved completely. Inconsistencies of some previous
derivations of the Lifshitz formula are traced briefly. For completeness of the
presentation, the necessary mathematical facts are also stated, namely,
solution of the Maxwell equations for configurations under consideration,
scattering formalism for parallel plane interfaces, determination of the
frequency equation roots, and others.
