This paper investigates the determinants of directed technical change at the firm level in the electricity generation sector. We use firm-level data on patents led in renewable (REN)and fossil fuel (FF) technologies by 5,261 European firms over the period 1978-2006. We investigate how energy prices, market size and knowledge stocks affect firms' incentives to innovate in one technology relative to another and how these factors may thereby induce a shift from FF to REN technology in the electricity generation sector. We separately study small specialized firms, which innovate in only one type of technology during our sample period, and large mixed firms, which innovate in both technologies. We also separate the extensive margin innovation decision (i.e. whether to conduct innovation) from the intensive margin decision (i.e. how much to innovate). Overall, we find that all three factors - energy prices, market sizes and past knowledge stocks - matter to redirect innovation towards REN and away from FF technologies. Yet, we find that these factors have a larger impact on closing the technology gap through the entry (and exit) of small specialized firms, rather than through large mixed firms' innovation. An implication of our results is that firm dynamics are of direct policy interest to induce the replacement of FF by REN technologies in the electricity generation sector.