In cognitive radio networks, multiple secondary systems can access a licensed spectrum when none of the secondary transmitters cause harmful interference to the Primary Users (PUs). For spectrum sharing with coordination among co-located secondary systems, we propose both centralized and distributed beamforming algorithms. The proposed algorithms minimize the total transmit power of secondary systems, while maintaining the interference to PUs below a certain threshold and satisfying the Quality-of-Service (QoS) constraint for each secondary system. The centralized algorithm achieves the optimal transmit power by exploiting the virtual uplink-downlink duality using the knowledge of the channel state information for all the secondary links. However, the assumption of global channel knowledge at each secondary system may not be allowed in practical applications for multi-cell coordination. To address this problem, we design a distributed transceiver beamformer that satisfies the interference constraint to protect PUs. On the basis of this distributed beamformer, we also propose power allocation algorithms that guarantee the QoS for secondary systems. Distributed beamforming and power allocations operate iteratively to minimize the total transmit power. Simulation results show that the distributed algorithms achieve a near-optimal transmit power while satisfying both the QoS and interference constraints.