This paper considers optimum allocation of transmission powers in next generation networks. The proposed framework is general enough to cover both emerging heterogeneous network (HetNet) architectures and cognitive radio (CR) networks. There are two types of users in our model. Type 1 users (T1U) represent either femtocell users in a HetNet, or secondary users in a CR network. Type 2 users (T2U) represent either macrocell users in a HetNet, or primary users in a CR network. T1Us share the same frequency band with T2Us, and they form an uplink to their intended base station (i.e., either the femtocell base station or the secondary base station) while causing interference to T2Us. The optimum power allocation strategy maximizing the aggregate communication rate of T1Us is found under individual transmission power constraints and a total interference power constraint at T2Us. It is shown that the optimum power allocation exhibits a binary structure, which means links are either "on" or "off", up to at most one exceptional fractional power level. Further, it is shown that T1Us transmitting at positive power correspond to the ones having better "joint" power and interference channel gains. Applications of these results are illustrated for well-known fading models such as Rayleigh, Rician-K, and Nakagami-m fading.