A spectrum leasing mechanism is proposed for the coexistence between a primary and a secondary network that is based on cooperation and opportunistic routing. The primary network consists of a source and a destination communicating via a number of primary relay nodes. In each transmission slot, the next hop is selected in an on-line fashion based on the decoding outcomes in the previous transmissions according to the idea of opportunistic routing. The secondary nodes may serve as potential next hops for the primary network, but only in exchange for leasing of spectral resources so as to satisfy secondary quality-of-service constraints. Four policies based on spectrum leasing via opportunistic routing are proposed that provide different tradeoffs between gains in throughput and overall energy expenditure for the primary network. Analysis is carried out for networks with a linear geometry and quasi-static Rayleigh fading statistics by using Markov chain tools.