Infrared absorption by a local or resonant mode is considered in the presence of anharmonic terms in the crystal potential energy. The idea of two coupled systems, the local mode and the other normal modes of the lattice, is developed and compared with the coupling between an electronic system and the lattice. An analogy between these two situations has often been drawn in the literature. It is shown that an anharmonic coupling term quadratic in the local-mode coordinate and linear in the lattice modes can lead to the main feature of this analogy, a Debye-Waller factor for the main local-mode absorption peak, if the local-mode frequency is high compared to that of any of the lattice modes. The problem is tackled without this condition using perturbation theory, and the results obtained are essentially the same as those given by the Green's-function method as developed, for example, by Maradudin. The Debye-Waller factor and the perturbation-theory expression are compared for the $U$ center in KCl and Ca${\mathrm{F}}_{2}$, and for a hypothetical example of an inband resonant mode. Some less well publicized features of the extraction of the absorption spectral function from its Fourier transform are discussed in an appendix.