When the Mentos come into contact with the Diet Coke, a reaction causes the rapid formation of foam.
The numerous small pores on the candy's surface catalyze the release of carbon dioxide (CO2) gas from the soda, resulting in the rapid expulsion of copious quantities of foam. Although any carbonated beverage will produce a similar effect, the reaction was popularized using Diet Coke for seemingly producing the best results.