Newly documented Ring Moat Dome Structures (RMDSs), low mounds typically several hundred meters across with a median height of ~3.5 m and surrounded by moats, occur in the lunar maria. They appear to have formed synchronously with the surrounding mare basalt deposits. It has been hypothesized that they formed on the surfaces of lava flows by the extrusion of magmatic foams generated in the flow interiors as the last stage of the eruption and flow emplacement process. We develop a theoretical model for the emplacement and cooling of mare basalts in which the molten cores of cooling flows are inflated during the late stages of eruptions by injection of additional hot lava containing dissolved volatiles. Crystallization of this lava causes second boiling (an increase in vapor pressure to the point of supersaturation due to crystallization of the melt), generating copious quantities of vesicles (magmatic foam layers) at the top and bottom of the central core of the flow. Flow inflation of many meters is predicted to accompany the formation of the foam layers, flexing the cooled upper crustal layer, and forming fractures that permit extrusions of the magmatic foams onto the surface to form domes, with subsidence of the subjacent and surrounding surface forming the moats. By modelling the evolution of the internal flow structure we predict the properties of RMDSs and the conditions in which they are most likely to form. We outline several tests of this hypothesis. 1. Introduction: The volcanic origin of the lunar maria has been known confidently for more than fifty years (see reviews in Head, 1976; Hiesinger and Head, 2006; Spudis, 2016), but new very high-resolution image and altimetry data from the Lunar Reconnaissance Orbiter (LRO) have continued to reveal surprises, including the widespread occurrence of features originally detected by Schultz (1976) and Schultz et al. (1976), and now called Ring Moat Dome Structures (RMDSs) (Zhang et al., 2017). More than two thousand of these features were recently documented in numerous maria (Figure 1) (Zhang et al., 2017). Theories proposed for their origin, summarized in Zhang et al. (2017), include emplacement of domes of more viscous magma, extrusions into impact craters billions of years after mare emplacement, squeeze-ups or hornitos formed synchronously with lava flow emplacement, and extrusion of magmatic foams (i.e., lavas with greater than ~70% vesicularity, Mangan and Cashman, 1996) that developed below a cooling lava flow surface. The availability of LRO imaging (Robinson et al., 2010) and topographic (Smith et al., 2010) data, together with a better understanding of the ways in which magma is transferred from the lunar mantle to the surface (Wilson and Head, 2017a; Head and Wilson, 2017), and improvements in the analysis of patterns of gas release from lunar magmas (Rutherford et al., 2017; Wilson and Head, 2018a) have prompted recognition of the importance of the formation and extrusion of magmatic foams in shaping lunar volcanic features (Qiao et al., 2017, 2018a...