Determining the contribution of secondary gamma rays to the radiation dose produced by charged particles in space requires a knowledge of the cross sections for gamma-ray production by protons and alpha particles. The only data of this type that have been available have been for ∼145-MeV protons. In the experiment reported here, gamma-ray spectral measurements were made for protons of 16, 33, 56, and 160 MeV and alpha particles of 59 MeV incident on targets of low- and medium-Z materials. Absolute spectra were obtained, generally in the backward direction, with coincidence (pair) or anticoincidence (total-absorption) scintillation spectrometers. The analysis method used to correct for the imperfect spectrometer response yielded quantitative error estimates for the resultant spectra. A few measurements were made in the forward direction or at 90° to distinguish deviations from isotropy which were marked only for 16-MeV protons incident on a carbon target. From the spectra, cross sections were obtained for the production of specific gamma rays. Tables of these results include the probable nuclear reactions which produced the gamma rays. The production cross sections are plotted vs the average proton energy in the target for individual gamma rays for C and O. For each element, these individual production cross sections are added and the sums, which decrease with increasing proton energy, are compared with the total nonelastic cross sections predicted on the basis of intranuclear cascade calculations. The reasonably smooth variations of the total cross sections for gamma-ray production with atomic number are also shown. The proton inelastic scattering cross sections for specific levels correspond within error to 14-MeV neutron scattering data.