Janthina janthina, a bubble-rafting violet snail. The snail excretes mucus from its foot and uses the raft of bubbles to float from place to place.

Snails that get around on rafts of mucous-y bubbles inherited the talent from ancestors that carried their eggs around like balloons on a string, a new study finds. In the process, the slimy snails transformed themselves from ocean-floor dwellers to free-moving floaters.

The bubble-rafting snails are part of the family Janthinidae. They live their lives floating upside-down in the ocean, attached to clumps of mucous bubbles that give them buoyancy. Now, a new study finds that these snails are descendents of wentletraps, snails that live on the ocean floor and snack on coral. Developing rafting abilities would have given wentletraps' descendents access to a new food source, floating jellyfish.

The mucous-y snails have been known since the 1600s, but this is the first time that researchers have been able to trace the origin of their snotty ways. Researchers led by University of Michigan graduate student Celia Churchill suspected two possibilities: The first was that the rafts are an advanced version of a snail-moving technique called "droguing." Young marine snails produce a thread of mucus, or drogue, that helps them drift around like a kite on a string in the water. [See photos of the bubble-rafting snails]

Another possibility was that the rafts were modified versions of egg masses. Female wentletraps stay attached to their eggs via mucous threads, and empty egg capsules might have captured air, making the snails buoyant. Adding more mucus to the mix would have made this temporary floating effect permanent.

Either scenario seemed likely, at least until Churchill and her colleagues received a preserved specimen of the Australian rafting snail Recluzia.

"I started to dissect it, and when I pulled the float away, I noticed that there were tiny Recluzia on the float and egg capsules of the large female," Churchill said in a statement.

The hitchhiking snails were too tiny for researchers to tell whether they are male or female, but it's likely the tiny snails are males that stick with the female in order to mate. The features of Recluzia suggest that the snail is a transitional form between ocean floor-dwelling snails and raft-floaters — a sort of mollusk missing link.

According to the researchers, Recluzia developed its juvenile-snail-carrying float from the egg masses lugged around by ocean-floor snails. As a next step, all individuals evolved adaptations to start blowing their own mucous bubbles, leading to the raft-floating janthinids of today. In some janthinid species, the rafts still serve to carry eggs, while other janthinid snails gestate their eggs within their bodies.

The researchers report their findings Oct. 11 in the journal Current Biology.

You can follow LiveScience senior writer Stephanie Pappas on Twitter @sipappas. Follow LiveScience for the latest in science news and discoveries on Twitter @livescience and on Facebook.