Heat diffusion at the boundary of stratified media. Homogenized temperature field and thermal constriction