We performed optical and x-ray diffraction experiments on carbon doped cubic-GaN samples, deposited by plasma-assisted molecular beam epitaxy on ͑001͒ GaAs substrates, for various carbon concentrations. The samples were studied by Raman, photoluminescence, and photoluminescence excitation spectroscopies. These techniques give some insight into the mechanism of carbon incorporation in the material. Detailed analysis of these spectra leads to a picture in which carbon initially enters into N vacancies producing a marked improvement in the crystalline properties of the material. At higher concentrations it also begins to enter interstitially and form C complexes, with a consequent decrease of crystalline quality. This increase and later decrease of crystalline quality of our samples with the addition of C were also detectable in x-ray diffraction scans. A model calculation of the localized vibrations of the C atom in the GaN lattice allows for the interpretation of a feature in the Raman spectrum of some samples, which reinforces this view.