We present a mathematical formulation and construct a solution of a quasistatic prolem of thermoelasticity for the contact interaction of two layers pressed by a load slowly varying with time, normal to the contact plane, and guaranteeing the validity of conditions of plane strain. In addition, the contact interaction of layers is accompanied by nonstationary heat generation caused by the action of friction forces in the process of motion of one layer along the surface of the other with variable speed. These forces are related to contact pressure by the Amonton law. By introducing two unknown functions proportional to the heat flows through the contact surface, we reduce, the problem to a system of two Volterra-type integral equations for the Fourier transforms of these functions. We propose a numerical algorithm for the solution of this system taking into account the behavior of the kernels of these integral equations and distinctive features of the numerical inversion of Fourier transformation. We show that, in the case of interaction of two layers with identical geometric, mechanical, and thermal characteristics, the problem is reduced to a single integral equation. The analysis of this equation allows one to give a more detailed description of all properties of the tribosystem. For this special case, we study the influence of the input parameters of the problem and the distribution of the pressure load on the behavior of contact pressure and temperature.