The head and phantom scatter contribution to the output of a treatment machine have been determined for open and wedged 60Co γ-ray beams and 4, 8, 16 and 25 MV X-ray beams, using an extended and a small-sized phantom. The wedge factor variation with field size and phantom depth have been analysed as a function of both scatter components. For the wedged beams a stronger increase of the head scatter contribution with field size, i.e. 4-9% for field sizes increasing from 5 cm × 5 cm to 20 cm × 20 cm, has been observed compared with open beams. This result indicates that the wedge factor variation with field size is related to a change of the primary photon fluence. Our study shows that the ratio of the head and phantom scatter contribution for the wedged and open beams remains unchanged for all beams except the 4 and 25 MV X-ray beam. This implies that, except for these latter energies, the variation of the wedge factor with phantom depth is determined by the wedge-induced change of the primary photon energy fluence. For the 4 and 25 MV X-ray beam it is shown that the wedge factor is also influenced by a change of the phantom scatter contribution. The wedge factor for the 25 MV X-ray beam is strongly influenced by the electron contamination for phantom depths up to 6 cm. For the 60Co and the 4 MV photon beam it is shown that the wedge factor decreases slightly with increasing source-to-skin distance due to a reduced contribution to the total dose from photons scattered in the wedge. For clinical use, an algorithm is given to calculate the wedge factor variation with field size and phantom depth.