Electron beam propagation in a dense gas medium is numerically investigated. All the main phenomena that determine electron beam behavior in a gas (scattering and energy losses of the electrons on the gas atom molecules, ionization and excitation, electron thermalization, beam pinching, and influence of a magnetic guide field) are taken into account. The initial beam energy and the gas chamber dimensions are varied in a wide range; typical gas mixtures for the excimer lasers are considered. Graphs are given that allow the choice of the optimal electron beam energy that provides the maximum efficiency of the beam energy deposition into the gas, depending on the gas chamber dimensions.