A generation expansion planning strategy for distribution systems is proposed in this paper to derive the optimal generation mix considering decentralized storage units, variable generation units, dispatchable generation units and demand response. To better exploit the economic value of these investments, participation in reserve and energy markets is considered. As the investment and market bidding decisions are made sequentially, a multi-stage stochastic programming model is formulated to minimize the sum of long-term investment costs and short-term costs, which include fixed operation costs, variable operation and maintenance costs, emission costs, discomfort costs minus the market participation revenue. A case study based on modified Swiss data demonstrates the effectiveness of the proposed model, analyzes the impact of demand response and forecast errors and shows the importance of market participation.