We report experimental and theoretical near-edge x-ray absorption fine structure (NEXAFS) spectra of clean and arsenic-capped gallium arsenide and the pseudo-binary alloy indium-gallium arsenide. Experimental data were obtained using synchrotron-radiation total-photoelectron-yield spectroscopy from the Ga(M2,3), As(M2,3), In(N2,3), and In(M4,5) edges. In addition, both C(K) and 0(K) NEXAFS spectra, and photon-stimulated ion-desorption mass spectra were obtained to assess and monitor the sample cleanliness. The samples studied were grown by molecular-beam epitaxy at China Lake and capped with arsenic for protection during transit to the Stanford Synchrotron-Radiation Laboratory. We have found by monitoring the As edges that heating the samples to 300 or 350Ã‚Â°C completely removes the arsenic cap. Also, we find that after evaporation of the As cap, the NEXAFS spectra are identical for capped and uncapped samples. Theoretical calculations of the arsenic NEXAFS spectra were performed using a full multiple-scattering theory. The inputs to the calculations were ab initio phase shifts, calculated using pseudopotentials and a model geometry. Theoretical calculations of the arsenic NEXAFS spectra of In0.53Ga0.47As crystals are reported also. Here, the calculations are performed by creating many model crystals that have the appropriate stoichiometry and averaging the resulting spectra.