In this paper, a cognitive radio network which consists of a primary system with a pair of primary transmitter (PT) and a primary receiver (PR), and a secondary system with a secondary transmitter (ST), a secondary receiver (SR) and a secondary relay (R) is considered. It is assumed that the distances between the transmitter and receiver of both systems are so large that the aid of a relay is needed for a reliable communication. Moreover, the receiver of each system is assumed closer to the transmitter of the other system compared to its own transmitter. The considered protocol is based on the overlay paradigm where the unlicensed secondary system shares its relay with the licensed primary system and in return it accesses the licensed spectrum for its own transmission. In the first time slot, PT and ST transmit their signals to the relay while each receiver eavesdrops the signal of the other transmitter next to it. In the second time slot, the relay applies physical-layer network coding to the signal pair it decided in the previous time slot, through bit-wise XOR operation between primary and secondary information bits, modulates to the corresponding signal and broadcasts. Both receivers have the information bits of the other user from the signals received in the first time slot, hence they can extract their desired information bits by reapplying the bit-wise XOR operation to the bits received in the first and second time slots. The bit error probability (BEP) of the considered protocol for M-PSK modulation is analytically derived and supported via computer simulation results. The results show that the bit error performance of the primary system is significantly improved compared to the direct transmission case.