The theory of stepwise electron and laser excitation of atoms. I. Weak optical excitation case