The development of electricity spot trading provides an opportunity for microgrids to participate in the spot market transaction, which is of great significance to the research of microgrids participating in the electricity spot market. Under the background of spot market construction, this paper takes the microgrid including wind power, photovoltaic (PV), gas turbine, battery storage, and demand response as the research object, uses the stochastic optimization method to deal with the uncertainty of wind and PV power, and constructs a decision optimization model with the goal of maximizing the expected revenue of microgrids in the spot market. Through the case study, the optimal bidding electricity of microgrid operators in the spot market is obtained, and the revenue is USD 923.07. Then, this paper further investigates the effects of demand response, meteorological factors, market price coefficients, and cost coefficients on the expected revenue of microgrids. The results demonstrate that the demand response adopted in this paper has better social–economic benefits, which can reduce the peak load while ensuring the reliability of the microgrid, and the optimization model also ensure profits while extreme weather and related economic coefficients change, providing a set of scientific quantitative analysis tools for microgrids to trade electricity in the spot market.