Cognitive radio is an emerging technique for improving the utilization of radio frequency spectrum in wireless communication networks. In this paper, we mainly investigate the spectrum sharing problems in a cognitive radio network. We formulate the spectrum sharing problem as a game between primary services, and use Cournot game to obtain the optimal strategies for primary services. Furthermore, considering the reasonableness and fairness in spectrum sharing process, we propose a function of price depends on the channel quality and the QoS performance. Nash equilibrium is considered as the solution of this game. As static Cournot game may not be realistic, we proposed a dynamic game related to the learning rate. Then, the stability condition of the dynamic game for spectrum sharing is investigated. The optimal strategy which maximizes the utility of primary service can be obtained by contacting the size of spectrum demand for secondary users and the size of spectrum offered by primary services. Simulation results verify the feasibility and validity of the proposed algorithm.