We develop a model for the industry dynamics in the electricity market, based on mean-field games of optimal stopping. In our model, there are two types of agents: the renewable producers and the conventional producers. The renewable producers choose the optimal moment to build new renewable plants, and the conventional producers choose the optimal moment to exit the market. The agents interact through the market price, determined by matching the aggregate supply of the two types of producers with an exogenous demand function. Using a relaxed formulation of optimal stopping mean-field games, we prove the existence of a Nash equilibrium and the uniqueness of the equilibrium price process. An empirical example, inspired by the UK electricity market is presented. The example shows that while renewable subsidies clearly lead to higher renewable penetration, this may entail a cost to the consumer in terms of higher peakload prices. In order to avoid rising prices, the renewable subsidies must be combined with mechanisms ensuring that sufficient conventional capacity remains in place to meet the energy demand during peak periods.2020 Mathematics Subject Classification. 91A55, 91A13, 91A80. Key words and phrases. Mean-field games, optimal stopping, renewable energy, electricity markets.Peter Tankov and René Aïd gratefully acknowledge financial support from the ANR (project EcoREES ANR-19-CE05-0042) and from the FIME Research Initiative.* Corresponding author.1 According to Reuters, the US coal electricity generation industry has been in steep decline for a decade due to competition from cheap and abundant gas and subsidized solar and wind energy, and 39,000 MW of coal-fired generation capacity was shut since 2017, see https://www.reuters.com/article/us-usa-coal-decline-graphic/ u-s-coal-fired-power-plants-closing-fast-despite-trumps-pledge-of-support-for-industry-idUSKBN1ZC15A