The paper presents an exact analytical solution to the plane stress elastic boundary value problem of a half-plane with a periodic system of linear semi-infinite one-dimensional inclusions (stiffeners) orthogonal to the surface. The solution is given in the form of Papkovich-Fadl eigenfunction series whose coefficients are found exactly using functions biorthogonal to the eigenfunctions, and the series themselves are equivalent to trigonometric ones. The solution is used to assess the stress-strain state of the soil and rock mass interacting with a vertically loaded pile. At the same time, in the analytical solution, the distance between the stiffeners (piles) is chosen in such a way that they do not affect one another. In addition, the perfect interface between the pile and the soil and rock is assumed. The analytical solution to the 492 problem of pile-soil and rock interaction is compared with the numerical simulation, which was obtained in a 3D setting using the finite element method (FEM) implemented in the ZSoil software. The comparison indicates that the use of exact solutions to elastic two-dimensional problems can be quite effective in assessing the stress-strain state of a soil and rock mass interacting with a loaded pile.