Under perfect competition on the output market, first best technology subsidies in the presence of learning by doing are justified by knowledge spill overs that are not accounted for by individual companies. First best output subsidies are thus depending directly on the learning effects and are, if applicable, positive. Considering electricity markets, a setting of imperfect competition is more appropriate. We show that the second best output subsidy for learning by doing in renewable energies takes the market distortion due to imperfect competition into account and is of ambiguous sign. Based on simulations with a European electricity market model, we find that second best renewable energy subsidies are positive and only insignificantly impacted by market power. By contrast, the welfare gains from an optimal subsidy are considerably higher compared to a hypothetical situation of perfect competition.