Cognitive users can share spectrum with primary users under constraints on the interference that results. We present a new pricing strategy for sharing the primary users' available subchannels with cognitive users by optimizing the secondary and primary users' utilities while meeting the primary users' interference constraints. The primary users aim to maximize their revenues by sharing their subchannels with secondary users while ensuring that they achieve a minimum target capacity. On the other hand, the secondary users aim to maximize their capacity under three different constraints: consumed power, a given budget for sharing subchannels, and tolerable interference caused to the primary users. We introduce a sequential procedure based on a distributed algorithm to determine the resource allocation, interference thresholds and prices that satisfy the requirements of both parties in the network. Simulations show that the users face a tradeoff between capacity, power, and price.