In this paper, we propose a novel beamforming design to enhance physical layer security of a non-orthogonal multiple access (NOMA) system with the aid of artificial noise (AN). The proposed design uses two factors to balance the useful signal strength and interference at the strong and weak users, which is a generalized version of the existing beamforming designs in the context of physical layer security for NOMA. We determine the optimal power allocation among useful signals and AN together with the two optimal factors in order to maximize the secrecy sum rate (SSR). Our asymptotic analysis in the high signal-to-noise ratio regime provides an efficient and near-optimal solution to optimize the beamforming scalars and power allocation coefficients. Our analysis indicates that it is not optimal to form a beam toward either the strong user or the weak user in NOMA systems for security enhancement. In addition, the asymptotically optimal power allocation informs that, as the transmit power increases, more power should be allocated to the weak user or AN signals, while the power allocated to the strong user keeps constant. Our examination shows that the proposed novel beamforming design can significantly outperform two benchmark schemes.