Abstract Cognitive radio and cooperative communication are two new network technologies. So, the combination of these two new technologies is a novel solution to solve the problem of spectrum scarcity. Two main challenges exist in the integration of cognitive radio and cooperative communication. First, there is a lack of incentives for the participating wireless devices to serve as relay nodes. Second, there is not an effective relay selection policy. In this paper, we propose an online auction-based relay selection scheme for cooperative communication in cognitive radio (CR) networks. Specifically, we design an auction scheme through adopting stopping theory. The proposed scheme ensures that the primary user (PU) can effectively select a CR relay to transmit its packets in a given time bound. In addition, we have analytically proven the truthfulness and the individual rationality of our online auction scheme. Extensive simulations demonstrate that the proposed relay selection scheme can always successfully and efficiently select a proper relay for a PU and can achieve a higher cooperative communication throughput compared with the conventional schemes.