In Spain, energy is sold on a wholesale market that brings together the companies that generate it (and own and manage the plants) with the companies that retail it (and design the rates for their customers). This wholesale market works through a daily auction in which those who sell energy (generators) agree on prices with those who buy it (retailers).
The rules make all the auctions start with nuclear power, since this type of plant cannot be stopped (it is more expensive to turn them off and, after a while, turn them back on again than to leave them on all the time). This is why nuclear power is the first to get a price in the daily auction.
Next, is the turn of the renewable energies (in Spain it is mainly wind and solar). And finally, the most expensive energies participate in the auction, such as gas combined cycle or, less and less frequently, the energy obtained from coal.
The rules state that the last plant to participate (usually gas or coal) is the one that sets the so-called marginal price. This is the price that is going to be paid for the energy, whatever its origin.
Therefore, the price per kWh for renewable energies is the same as for the polluting energies, since they share the auction and marginal price. However, when energy generation successfully shifts to renewable sources, this marginal price will drop considerably.