From the book Mahabharata.
Devas (angels) held tail, asuras (demons) held head. The Naga is Vasuki.
Devas and Asuras fought for Amrita (the Elixir for Immortality) but got no result. So Vishnu asked them to work together. So they churn the milk of ocean. They used mount Madara as the pivot and Basuki as the rope.
Later mountain sank so Vishnu incarnated himself as the tortoise Kurma and used his back to support the mountain. Before producing the Amrita (elixir of immortality), the ocean of milk was churned for another 1000 years.
Also produced Lakshmi (wife of Vishnu), the elephant Airavata (mount for Indra), the horse Ucchaishravas, a wishing tree and a lovely Apsaras.
Once produced, fight broke out between devas and asuras to get Amrita. Vishnu intervened and helped the devas to win. When peace was made, Indra was reinstalled as the king of gods.