Fermi-Eyges electron-scattering theory has been incorporated into the primary dose calculation for external x-ray beam radiotherapy using the convolution method. Incorporating scattering theory into the convolution technique accounts for the density distribution between the interaction and deposition sites, whereas conventional convolution methods only consider the average density between these two points. As the lateral spread of electrons ejected from an interaction site depends on the density distribution, the energy deposition (and hence dose distribution) is predicted more accurately if scattering is accounted for. This new method gives depth dose curves which show better agreement with Monte Carlo calculations in a (slab inhomogeneity) lung phantom than a conventional convolution method, especially at high energies and small field sizes where lateral electronic disequilibrium exists at the central axis. For a 5 x 5-cm2 18-MV beam incident on the lung phantom, a reduction in the maximum error between the convolution and Monte Carlo depth dose curves from 5% to 2.5% is obtained when scattering theory is used in the primary dose calculation. Incorporating scattering theory into the convolution calculation increases the computation time of the primary dose by a factor of 3.