At night, just after the full moon, teams of scientists dive beneath the waves to study one of the planet’s most prolific and mysterious rites of reproduction.

It’s coral behaving badly — or very nicely, depending on your point of view. Warm ocean waters suddenly teem with trillions of eggs and sperm that swirl in the currents and merge to form new life, a profligate frenzy that can leave the ocean’s surface awash in pink flotsam.

Globally, hundreds of species of coral engage in primordial rites of mass spawning tied to seasonally warming waters and the lunar cycle.

“It’s like an underwater snowstorm,” said Emma L. Hickerson, a veteran diver and research coordinator at the Flower Garden Banks, a coral reef 100 miles off Texas in the Gulf of Mexico.