A method is derived to calculate the attenuation correction factors for elastic or inelastic X‐ray or neutron scattering experiments using a spherical sample. The method can be applied to a sphere that is either fully or partially illuminated by an incident beam of rectangular cross‐sectional area. The required input parameters are the energy‐dependent attenuation coefficients, the radius of the sphere and the dimensions of the incident beam. In‐plane scattering is assumed.