It is widely believed that gamma-ray bursts originate from neutron stars. A disturbance near the surface of a magnetized neutron star, whether due to a "starquake," an instability in an accretion disk, or some other phenomenon, can launch strong compressional Alfven waves into the atmosphere. In this paper, we show that such waves can accelerate particles by magnetic trapping; as the density of the atmosphere decreases away from the surface of the star, the condition for trapping can be satisfied for an extended time, resulting in acceleration of some particles to high energies. We find that the mechanism of phase-locked acceleration naturally produces a fairly hard, power-law spectrum when particle energy is converted to photons by bremsstrahlung. The photon spectra we obtain from our simple model can qualitatively reproduce several features of observed spectra. The mechanism can also account for the paucity of X-ray energy, relative to the energy in gamma-rays, that is observed in gamma-ray bursts. It is not sensitive to the underlying model and can account for the general features of bursters for both the "starquake" and the "disk" models; in the case of the "disk" model, we can also explain the observation in temporally resolved data of a burst of gamma-rays, followed by X-rays.