Neutron-induced spectroscopy measurements are commonly used to quantify in situ elemental compositions of rocks from the processing of measured gamma-ray energy spectra. However, geometric effects on the measured spectroscopy logs, such as thin beds, dipping beds, and deviated well trajectories, can cause shoulder-bed averaging that compromises the assessment of the true layer elemental composition. We have developed an inversion-based interpretation method to evaluate layer elemental compositions from spectroscopy measurements acquired with a commercial 14-MeV pulsed-neutron logging-while-drilling spectroscopy tool. The algorithm is based on a new spectroscopy fast-forward simulation technique, and it estimates layer-by-layer elemental relative yields, weight concentrations, and their uncertainties. Calculations are performed with inelastic and capture gamma-ray spectroscopy measurements that arose from high- and low-energy neutron interactions, respectively. This strategy provides two sets of data that independently validate estimated elemental compositions and can ascertain chemical elements present in only one measurement mode. In laminated formations in which layer thicknesses are appreciably below the vertical resolution of the tool, it is impossible to quantify layer properties with inversion methods. We have therefore developed an additional interpretation method based on a spectroscopy mixing law to estimate elemental compositions within individual laminae. The new inversion-based interpretation methods were successfully verified with two challenging synthetic cases and implemented in two field cases with varying lithology and well trajectories. Our results found that the developed methods reduced shoulder-bed averaging effects on the measured spectroscopy logs by as much as a 0.4 yield fraction and a 0.17 weight fraction. Estimated elemental compositions with reduced shoulder-bed averaging effects improved the calculations in subsequent spectroscopy-based petrophysical interpretation.