The distribution of photons detected in a spectrometer as a function of their path length in the sample can be approximated by a one-parametric family of functions. The members of the family, having different average path lengths, describe the transport of photons in samples of different shapes. The value of the parameter corresponding to the actual counting geometry is obtained from the measured average path of photons in the sample. The self-attenuation factor as a function of the attenuation coefficient is calculated as the Laplace transform of the member of the family, defined by the extracted value of the parameter.