A mathematical model for an energy‐dispersive X‐ray spectrometer is proposed, which is based on the analysis of the radiation transport in a sample and in a detector, and an electron transport in the detector. The results obtained by using this model are compared with experimental data. The influence of parameters of sources of the primary X‐rays, and the thickness and material of the detector on the signal‐to‐background ratios, was estimated. These ratios limited by electron and photon transport were compared. It is shown that the signal‐to‐background ratio can vary by several orders of magnitude at changing conditions of recording, and there are conditions when the use of Si or Ge detector is preferable. Copyright © 2009 John Wiley & Sons, Ltd.