In this paper, we investigate a nonconvex fractional quadratically constrained quadratic problem (fractional QCQP), which has a wide application to the resource allocation optimization in wireless communication systems. Different from the state-of-the-art methods needing to solve semidefinite programmings or second-order cone programmings, we propose a fast algorithm for solving fractional QCQP by combining the successive convex approximation method and the consensus alternating direction method of multipliers, which has only simple computations and works very fast in applications with modest accuracy. We also apply the proposed fast algorithm to secure beamforming design for enhancing physical layer security in cognitive nonorthogonal multiple access (NOMA) networks, where secrecy rate optimization problems in both underlay and overly cognitive NOMA networks are typical fractional QCQPs and have not been well studied. Simulation results have shown that our proposed fast algorithm achieves almost the same performance as the state-of-the-art methods, however, the proposed fast algorithm has very low computation complexity.