If energy is the only input to making a solar cell (the worst case) and the cell costs x Wh then the market price can't go below x * ($/Wh), so it pays back when you produced x Wh (thus not buying x Wh from the coal burning power plant) and any energy you produce is both profit for you, and also less total demand for coal energy.
If energy is the only input to making a solar cell (the worst case) and the cell costs x Wh then the market price can't go below x * ($/Wh), so it pays back when you produced x Wh (thus not buying x Wh from the coal burning power plant) and any energy you produce is both profit for you, and also less total demand for coal energy.