Resonances in Scattering. I. Basic Equations and Main Approximations