Hard coatings are more and more used to improve the mechanical and tribological behavior of surfaces. Thermomechanical cracking can occur in these coatings when they slide under heavy loads. We present a two-dimensional model of a finite thickness layered medium submitted to a moving heat source. The analytical solution of the temperature and thermoelastic stress fields is obtained using Fourier transforms. The behavior of each layer is described by transfer-matrices and a relation between the displacement- and stress-vectors is given. The originality of the study is the use of a Fast Fourier Transform algorithm. With this method, calculation time is reduced, no singularity problems are met in the inverse transform and each parameter (especially the thickness of the layers) can be studied over a wide range.