The stress-strain state of a plastic layer under compression by two rigid parallel rough plates under conditions of plane deformation is investigated. The hypothesis of flat sections is used. Tangential stresses are found in the part of the layer under load, as an approximate solution of the system of equations of the stress-strain state of the compressible layer. The solution is obtained in analytical form. On this basis the velocities of the points of the layer are calculated in the analytic form. The size and shape of the free surface are calculated depending on the thickness of the layer. The coefficients of this dependence are determined by recurrent relations. On this basis, an algorithm for finding the shape of a free surface is found. The computational experiments are provided and the results are compared with results obtained with FEM and ANSYS.