More and more attention has been paid to the development of renewable energy in the world. Microgrids with flexible regulation abilities provide an effective way to solve the problem of renewable energy connected to power grids. In this article, an optimization strategy of a microgrid participating in day-ahead market operations considering demand responses is proposed, where the uncertainties of distributed renewable energy generation, electrical load, and day-ahead market prices are taken into account. The results show that, when the microgrid implements the demand response, the operation cost of the microgrid decreases by 4.17%. Meanwhile, the demand response program can transfer the peak load of the high-price period to the low-price period, which reduces the peak valley difference of the load and stabilizes the load curve. Finally, a sensitivity analysis of three factors is carried out, finding that, with the increase of the demand response adjustable ratio or the maximum capacity of the electrical storage devices, the operation cost of the microgrid decreases, while, with the increase of the demand response cost, the operation cost of the microgrid increases and, finally, tends to the cost without the demand response. The sensitivity analysis reveals that the demand response cost has a reasonable pricing range to maximize the value of the demand response.