In this paper, we analyze the multiuser diversity gain in a cognitive radio (CR) system where the secondary transmitters opportunistically utilize the spectrum licensed to primary users only when it is not occupied by the primary users. To protect the primary users from the interference caused by missed detection of primary transmissions at the secondary receivers, minimum average throughput of the primary network is guaranteed by transmit power control at the secondary transmitters. The traffic dynamics of a primary network are also considered in our analysis. We derive the average system throughput of the secondary network and analyze its asymptotic behaviors to characterize the multiuser diversity gain in the CR system. It is shown that the throughput gain of the CR system depends on the levels of the peak power constraints on the secondary transmitters and the reliability of spectrum sensing. The asymptotic scaling law of the secondary network throughput is also shown to be different according to maximum allowable transmit power at the secondary transmitters. The derived scaling law is interestingly similar to that in underlay CR systems even though the spectrum utilization mechanism of the underlay CR systems is totally different from the CR model considered in this paper. We also extend our results to non-independent and identically distributed (non-i.i.d.) channels by employing fairness scheduling and show that fairness scheduling in non-i.i.d. channels has the same asymptotic throughput characteristics as the best user selection in i.i.d. channels.