I study firms' behaviour in markets where firms' long-run capacity decisions, made in the presence of uncertain demand, constrains short-run competition. In Chapter 2, I analyse firms' investment and pricing incentives in a differentiated products framework with uncertain demand. Firms choose production capacities before observing demand and choose prices after demand is realised. Unlike previous models, when firms are identical, symmetric pure-strategy equilibria exist, even in the presence of very low capacity costs. Furthermore, industry capacity in these symmetric equilibria is strictly greater than the equivalent Cournot equilibrium industry capacity for low costs, and equal to the Cournot industry capacity for higher costs. Subsidies on capacity costs have a greater positive impact on equilibrium capacity than an equivalent subsidy on production costs. In Chapter 3, I use this model to analyse how the market changes when firms practice `withholding'. This is when firms withdraw capacity from the market in the short-run, after demand is realised, in the hope of making greater profits. I show that withholding is an optimal strategy for firms in these markets, and that compared to the no-withholding case, equilibrium output is lower in low demand states and higher in high demand states. Equilibrium capacity strictly increases. I discuss why it is hard to find real world examples of withholding in action, despite the increased profits. Chapter 4 looks at the specific case of the electricity industry. Electricity markets are a good example where capacity constraints and random demand affect competitive outcomes. However, trade in electricity is subject to additional constraints caused by the transmission of electricity through a network. Network constraints are well understood to cause considerable non-convexities in firms' optimisation problems; thus theoretical models have limited use in analysing the behaviour of electricity generating firms. An alternative approach, economic experiments, has become an important tool to study these markets, but questions remain on whether subjects can really imitate large firms in the presence of such complexity. This chapter provides evidence in the affirmative, specifically showing that experimental subjects can understand loop flows in the presence of Kirchoff's Laws, a key physical constraint, and how this affects firms' pricing decisions. The results suggest that electricity market experiments could be scaled up successfully to more realistic networks.