In the face of unprecedented challenges in environmental sustainability and grid resilience, there is an increasingly held consensus regarding the adoption of distributed and renewable energy resources such as microgrids (MGs), and the utilization of flexible electric loads by demand response (DR) to potentially drive a necessary paradigm shift in energy production and consumption patterns. However, the potential value of distributed generation and demand flexibility has not yet been fully realized in the operation of MGs. This study investigates the pricing and operation strategy with DR for a MG retailer in an integrated energy system (IES). Based on co-optimizing retail rates and MG dispatch formulated as a mixed integer quadratic programming (MIQP) problem, our model devises a dynamic pricing scheme that reflects the cost of generation and promotes DR, in tandem with an optimal dispatch plan that exploits spark spread and facilitates the integration of renewables, resulting in improved retailer profits and system stability. Main issues like integrated energy coupling and customer bill reduction are addressed during pricing to ensure rates competitiveness and customer protection. By evaluating on real datasets, the system is demonstrated to optimally coordinate storage, renewables, and combined heat and power (CHP), reduce carbon dioxide emission while maintaining profits, and effectively alleviate the PV curtailment problem. The model can be used by retailers and MG operators to optimize their operations, as well as regulators to design new utility rates in support of the ongoing transformation of energy systems.