We present a complete account of our recent work [Phys. Rev. A 44, 31 (1991)] in which we investigate the theory of cancellation by interference between the absorption of three fundamental laser photons and one third-harmonic photon. The theory is formulated in terms of the density matrix so as to take detunings, dephasing, and laser bandwidth into account. The result is a theory of cancellation for finite detuning that explains how four-photon resonances can be canceled by a three-photon mechanism if there is an atomic level at near-three-photon resonance. The treatment is extended to focused beams and the interplay between phase matching and cancellation is investigated. We obtain explicit conditions for cancellation to occur, and perform calculations pertaining to a recent experiment where cancellation of 4 + 1 resonantly enhanced multiphoton ionization has been observed.