Boundary layer problems in diffraction theory