We explore optimal investment in Research and Development activities among energy producers in a competitive market. R&D effort is costly and results in discrete technological advances that gradually lower production costs. The aggregate cost profile is thus expressed as a stochastic multi-dimensional counting process, individually controlled by the players. Our model combines features of patent racing with dynamic market structure, capturing the interplay between the immediate competition in terms of production rates and the long-term competition in R&D. Using a Cournot model of competition we analyze the resulting Markov Nash equilibrium which reduces to analysis of a sequence of the one-step static games arising between R&D successes. Several numerical examples and extensive analysis of the emerging comparative statics will be given. This is joint work with Ronnie Sircar (Princeton).