Photon dose calculation algorithms (such as the pencil beam and collapsed cone, CC) model the attenuation of a primary photon beam in media other than water, by using pathlength scaling based on the relative mass density of the media to water. In this study, we assess if differences in the electron density between the water and media, with different atomic composition, can influence the accuracy of conventional photon dose calculations algorithms. A comparison is performed between an electron-density scaling method and the standard mass-density scaling method for (i) tissues present in the human body (such as bone, muscle, etc.), and for (ii) water-equivalent plastics, used in radiotherapy dosimetry and quality assurance. We demonstrate that the important material property that should be taken into account by photon dose algorithms is the electron density, and not the mass density. The mass-density scaling method is shown to overestimate, relative to electrondensity predictions, the primary photon fluence for tissues in the human body and water-equivalent plastics, where 6%-7% and 10% differences were observed respectively for bone and air. However, in the case of patients, differences are expected to be smaller due to the large complexity of a treatment plan and of the patient anatomy and atomic composition and of the smaller thickness of bone/air that incident photon beams of a treatment plan may have to traverse. Differences have also been observed for conventional dose algorithms, such as CC, where an overestimate of the lung dose occurs, when irradiating lung tumors. The incorrect lung dose can be attributed to the.incorrect modeling of the photon beam attenuation through the rib cage (thickness of 2-3 cm in bone upstream of the lung tumor) and through the lung and the oversimplified modeling of electron transport in convolution algorithms. In the present study, the overestimation of the primary photon fluence, using the mass-density scaling method, was shown to be a consequence of the differences in the hydrogen content between the various media studied and water. On the other hand, the electron-density scaling method was shown to predict primary photon fluence in media other than water to within 1%-2% for all the materials studied and for energies up to 5 MeV. For energies above 5 MeV, the accuracy of the electron-density scaling method was shown to depend on the photon energy, where for materials with a high content of calcium (such as bone, cortical bone) or for primary photon energies above 10 MeV, the pair-production process could no longer be neglected. The electron-density scaling method was extended to account for pair-production attenuation of the primary photons. Therefore the scaling of the dose distributions in media other than water became dependent on the photon energy. The extended electron-scaling method was shown to estimate the photon range to within 1% for all materials studied and for energies from 100 keV to 20 MeV, allowing it to be used to scale dose distributions to media other than water and generated by clinical radiotherapy photon beams with accelerator energies from 4 to 20 MV.