We study the impact of learning-by-doing with spillovers in competitive markets with free market entry. Within a two period model, we consider first the case where fixed costs are incurred only once, and entry is once and for all. In the second case fixed costs are incurred in each period, and both market exit after the first period and late entry in the second period is possible. For the first case first best allocations can only be decentralized by subsidizing output in the first period and additionally paying an entry premium. If exit and late entry are possible and if market exit by some firms is socially optimal, the optimal policy scheme requires a nonlinear output subsidy which serves to discriminate between exiting and staying firms. We further investigate the comparative statics effects of the different policy instruments.