Diffraction methods in the spectroscopy of thin films in the vicinity of resonances