This paper studies the power control problem for spectrum sharing based cognitive radio (CR) networks with multiple secondary source-to-destination (SD) pairs. A simple distributed algorithm is proposed for the secondary users (SUs) to iteratively adjust their transmit powers to improve the performance of the network. The proposed algorithm does not require each SU (or PU) to negotiate with other SUs (or PUs) during the communication. It is proved that the proposed algorithm can obtain a time average performance as good as that achieved when the Nash equilibrium (NE) is chosen in hindsight. More specifically, the average performance of CR networks will converge to an ε-Nash equilibrium at a rate of Tε = O (exp (1/ε)). A sub-optimal algorithm is also introduced to further improve the convergence rate to Tε'/log Tε' = O (1/ε'). Numerical results are presented to show the performance of the proposed algorithms under different settings.