In 1951, Yang derived formulas for computing the pathlength distribution of particles traversing foils, considering only the multiple-scattering process. We here improve upon the accuracy of that work, by using our second-order small-angle approximation. We derive the general solution for a broad parallel beam, and find simple formulas for Yang's two special cases: the pathlength distribution of all the particles at a particular point, taken together; and the pathlength distribution at a particular point of only those particles with zero net angular deflection. From the pathlength (or excess pathlength) distribution, residual range and energy distributions can immediately be deduced. All this work assumes relatively small energy loss, and we consider 5 MeV electrons penetrating lead, which provides considerable scattering without major energy loss. The second-order energy distribution is found to differ considerably from the (first-order) Yang energy distribution, and to agree more closely with EGS4 Monte Carlo calculations.