Optically-detected magnetic resonance (ODMR) and positron annihilation spectroscopy (PAS) experiments have been employed to study magnesium-doped GaN layers grown by metal-organic vapor phase epitaxy. As the Mg doping level is changed, the combined experiments reveal a strong correlation between the vacancy concentrations and the intensity of the red photoluminescence band at 1.8 eV. The analysis provides strong evidence that the emission is due to recombination in which electrons both from effective mass donors and from deeper donors recombine with deep centers, the deep centers being vacancy-related defects.