Resonant absorption of a chemically sensitive layer based on waveguide gratings.