Nuclear proliferation concerns have resulted in a desire for radiation detectors with superior energy resolution. In this dissertation a Monte Carlo code is developed for calculating energy resolution in gamma-ray detector materials. The effects of basic material properties such as the bandgap and plasmon resonance energy are studied using a model for inelastic electron scattering based on electron energy-loss spectra. From a simplified "toy model" for a generic material, energy resolution is found to oscillate as the plasmon resonance energy is increased, and energy resolution can also depend on the valence band width. By incorporating the model developed here as an extension of the radiation transport code Penelope, photon processes are also included. The enhanced version of Penelope is used to calculate the Fano factor and average electron-hole pair energy in semiconductors silicon, gallium arsenide, zinc telluride, and scintillators cerium fluoride and lutetium oxyorthosilicate (LSO). If the effects of the valence band density-of-states and phonon scattering are removed, the calculated energy-resolution for these materials is fairly close to that for a toy model with a uniform electron energy-loss probability density function. This implies that the details of the electron cascade may in some cases have only a marginal effect on energy resolution.