A number of presently unanswered questions concerning H2O and CO2 on Mars may be addressed using data from an orbital gamma ray spectrometer such as the one planned for the Mars Observer mission. Problems that could be addressed include the ice/dust ratio of the polar layered deposits; the dust content and thickness of polar perennial ice; the water content of hydrated silicates; the depth, distribution, and concentration of ground ice; the possible existence of liquid water “oases”; and the thickness, variability, and H2O content of the seasonal CO2 frost cap. We investigate the capability of an orbital gamma ray spectrometer to address these problems by calculating the gamma ray signal produced by the Martian atmosphere and by several simple models of Martian surface materials. The Martian surface is modeled as one or two layers composed of various arrangements of “Viking soil,” H2O, and CO2. We calculate (1) the production of neutrons in the atmosphere and in the subsurface material by cosmic ray interactions, (2) the scattering of neutrons and the resultant neutron energy spectrum and spatial distributions, (3) the production of gamma rays by neutron prompt capture and nonelastic scatter reactions, (4) the production of gamma rays by natural radionuclides, (5) the attenuation of the gamma ray signal by passage through surface materials and the Martian atmosphere, (6) the production of the gamma ray continuum background, and (7) the uncertainty in gamma ray line strengths that results from the combined signal and background observed by the detector. Two types of data give us information about the concentration and distribution of hydrogen: the strength of the 2.223‐MeV line of H and the ratio of gamma rays from inelastic scatter to gamma rays due to prompt capture for an element such as Si or Fe. The latter provides information about H by giving an indirect indication of the nature of the neutron energy spectrum. The two techniques are sensitive to the presence of H at different depths. Using both techniques then, we in many cases will be able to determine uniquely both the thicknesses and the H2O content of layers on the Martian surface from the gamma ray signal that will be observed. For investigation of CO2 layers, we can use both the 4.945‐MeV prompt capture line of carbon and, in some cases, the attenuation produced by passage of gamma rays from natural radionuclides through a CO2 layer to determine layer composition and thickness. Our results show that orbital gamma ray data can be used to extract a considerable amount of information about the quantity and vertical distribution of volatiles near the Martian surface. The addition of the capability to measure independently the neutron energy spectrum will further enhance the usefulness of this experiment.