The companies here (not Germany) can afford to pay for the right to put electricity in the grid because they are guaranteed a fixed compensation by the state for all the renewable electricity produced – at a rate that's several times the market price. Thus even at times when they have to pay, they still make more money than if they shut down the plants – which itself would just cost money.