Abstract A general analytical theory of depth profiling using narrow resonances is outlined. It is shown how some basic features of the stochastic theory of fast ion slowing down in disordered matter may be turned to advantage for a rigorous calculation of yield excitation curves corresponding to targets of various composition. Depth profiles may be extracted from the experimental data by fitting the latter with curves calculated for profiles chosen through an optimization procedure. For sufficiently broad resonances, Γ ∼ 1 keV, it may be shown that good agreement with the experimental data is obtained if the correct energy loss spectra deduced from the stochastic slowing down theory are replaced in the calculations by Gaussian spectra at all depths. This leads to very simple computer programs, fast to operate with small computers. For very narrow resonances, Γ ∼ 100 eV, the calculations require the use of the full stochastic theory. Such calculations account for the overshoot in the excitation function near the resonance energy observed for thick targets, known as the Lewis effect. Possible uses of both medium and high energy resolution resonance depth profiling in various fields of research are illustrated. The optimization of the experimental conditions (stability and energy spread of the beam, carbon deposition, etc) and the automatic recording of the data for fast operation are discussed.