We introduce a theoretical framework for the analysis of competition between a traditional and a renewable generator in a spot electricity market where the electricity from renewable sources is always the first to be dispatched. The model accounts for randomness in the availability of renewable capacity due to the partial unpredictability of weather conditions. Competition is studied through a model of strategic investments for entry deterrence with two post entry competition settings: the Cournot framework in a two stage game and the dominant firm-competitive fringe setting in a three stage game. Both models show that the renewable producer exploits merit order rule by strategically investing in a large generation capacity in order to crowd out the production of its rival. The analysis has important implications for electricity market design.