The Green functions and Kubo linear-response theory are used to calculate the absorption coefficient of a collection of diatomic molecules embedded in a one-dimensional lattice. The effect of the environment is restricted to the coupling between the molecular internal vibration and lattice vibrations. For the molecular oscillators, both harmonic and anharmonic models are considered. The absorption line shape is expressed in closed form whether the molecular frequency falls outside or within the allowed phonon frequency range. In both cases a frequency shift is found. In the anharmonic case there is a broadening of the absorption lines. Expressions for the shift and line width are given.