Among others, lateral earth pressure on a rigid retaining wall is one of the soil mechanics problems which can be successfully solved using the granular mechanics, provided that the contact force network is caused by the soil own weight. Assessment of the backfill stress state is reduced to the geometric problem of determining the intersections between the force network lines and the backfill sloping surface, having account of the constraints imposing by the wall back side. The backfill pressure on the wall may be calculated by finding the stress tensor at every point of the backfill, or by applying the law of sines to the unit forces polygon. In this paper, the coefficient of lateral earth pressure is derived for two cases: A backfill with uniform stress state, and a backfill with wall friction; both of them at rest and plastic states. For yielding soils, the first case is compared with the generalized Rankine's theory, revealing the total conformity of both theories; and the second, with the rigorous Boussinesq's plastic theory, showing to be the best fit. From the results, it is concluded that granular mechanics compresses in a unique theory the at rest and plastic states of granular soils, furnishes generalized formulas for calculating the lateral pressure exerted by a straight-boundary soil, and provides a rigorous but very simple method for a broken-boundary soil.