We have successfully grown Be-doped p-type GaN on a sapphire (0001) substrate by radio frequency plasma assisted molecular beam epitaxy (RF-MBE) by conserving the surface polarity during growth. It is found that while the surface polarity of undoped GaN grown on a sapphire (0001) substrate is N-terminated, it changes from N- to Ga-terminated during the growth of Be-doped GaN. When this polarity change occurs, the resistivity of the grown layer is extremely high. Moreover, a broad deep level photoluminescence distinctly appears around 2.0 eV. When an AlN buffer layer is used, a GaN layer on this buffer layer can be grown under the Ga-terminated condition. By growing Be-doped GaN on the Ga-terminated GaN, we have successfully grown Be-doped p-type GaN without the polarity change. In addition, the optical property of the sample is markedly improved. We have confirmed that the Be acceptor level is shallower than the Mg acceptor level by approximately 100 meV.