In cognitive radio systems, secondary users can share the spectrum with the primary user as long as the quality of service (QoS) of the primary system is guaranteed. However, the system throughput of the cognitive system will be limited when the QoS requirement is stringent. Recently cooperative diversity has been proposed as a powerful method that can provide dramatic gains in wireless environments. In this paper, we investigate the problem of spectrum sharing together with adaptive user cooperation in heterogeneous cognitive relay system. To maximize the throughput of the cognitive system, one best relay will be selected and besides, optimal power allocation is performed between the source and the relay. In addition, beamforming is applied to further reduce the interference and improve the system performance. Simulation results show the improvement of the throughput as opposed to the direct transmission.