Heating of organic matter to progressively higher temperatures causes a sequence of chemical changes in which carbonate minerals are first dissolved, then precipitated, and then again dissolved. The initial carbonate dissolution is related to the production of organic acids. As heating continues, organic acids begin to decompose to carbon dioxide and methane. This addition of carbon dioxide to a solution with an organic-acid pH buffer causes carbonates to precipitate. Eventually, a temperature is reached at which any remaining organic acids quickly decompose. Addition of carbon dioxide to a solution in which carbonate species rather than organic acids now control the pH lowers the pH and causes renewed carbonate dissolution. The similarity of this sequence to the carbonate paragenesis of Mississippi Valley-type deposits suggests that the carbonate paragenesis in these deposits may be related to the thermal alteration of organic matter. By competing with fluoride for magnesium, bicarbonate ions from decarboxylation off organic matter and dissolution of carbonates may break the MgF+ complex, form the MgHCO3+ complex, and thereby liberate fluoride to trigger the precipitation of fluorite.