Planet-eating cloud

Immense cloud lifeform

A gigantic cloud-like lifeform from beyond the galaxy that consumed whole planets, until Spock persuaded it to turn back.

The cloud was a living being of incredible size, many thousands of kilometers across, that entered the galaxy from outside and fed on planets, absorbing their matter whole.
In One of Our Planets Is Missing, it had already consumed several worlds on the edge of Federation space and was heading toward the inhabited planet Mantilles. The Enterprise was drawn inside it. Spock mind-melded with the creature, helped it understand it was killing intelligent beings, and it agreed to leave the galaxy and return home.