In this letter, an optimal power allocation in the two-way relay channel of four transmission nodes employing the physical-layer network coding (PNC) protocol is proposed to improve the network sum-rate of the two-way relay system. The optimal power allocation is obtained by maximizing the network sum-rate of the PNC protocol under a sum-power constraint in a Rayleigh fading channel environment. Analytical and simulation results show that the proposed power allocation can improve the network sum-rate. Furthermore, compared with the equal power allocation scheme, the proposed power allocation scheme can achieve much higher network sum-rate performance.