We study the amplitude and phase signals detected in infrared scattering-type near field optical microscopy (s-SNOM) when probing a thin sample layer on a substrate. We theoretically describe this situation by solving the electromagnetic scattering of a dipole near a planar sample consisting of a substrate covered by thin layers. We perform calculations to describe the effect of both weakly (Si and SiO(2)) and strongly (Au) reflecting substrates on the spectral s-SNOM signal of a thin PMMA layer. We theoretically predict, and experimentally confirm an enhancement effect in the polymer vibrational spectrum when placed on strongly reflecting substrates. We also calculate the scattered fields for a resonant tip-substrate interaction, obtaining a dramatic enhancement of the signal amplitude and spectroscopic contrast of the sample layer, together with a change of the spectral line shape. The enhanced contrast opens the possibility to perform ultra-sensitive near field infrared spectroscopy of monolayers and biomolecules.