Metamorphoses Book 4: Perseus and Andromeda
Perseus, whose mother, Danae, was impregnated by Jove in a shower of golden rain, flew over the earth with Medusa's severed head in his hands. Drops of blood that fell into Libya turned into deadly snakes that remain in the desert to this day. Blown around the earth three times, Perseus landed in the land of Atlas to rest and take off the winged sandals he'd borrowed from Mercury and the nymphs.
Atlas was a giant who ruled the farthest lands and seas of the earth. His land was covered with golden orchards and numerous herds. When Perseus introduced himself as the son of Jove, Atlas mistook him for the son of Jove prophesied to steal the Golden Fleece from his orchard. To protect his treasure, Atlas tried to send Perseus away, but Perseus would not give up. He showed the head of Medusa to Atlas, and it turned the giant into a mountain.
When Perseus began his flight over earth again, he saw Andromeda chained to a rock by the sea. He fell in love and flew down to where she was and asked her why she was there. She bashfully and tearfully explained that her mother had bragged about her own beauty so much that she had roused the jealousy of the Nerieds. To please them, Neptune was going to flood the earth, but the oracle of Jupiter said that Neptune would be appeased if Andromeda was chained to a rock by the sea as a sacrifice to the sea monster.
As the monster approached, Perseus struck a deal with her parents that if he saved her from the monster, he would marry her and inherit their lands. They agreed, and he defeated the sea monster.
After the battle, he wrapped Medusa's head in seaweed to protect it, and it turned the seaweed into rock. That's how coral was formed.
Perseus made three altars and three sacrifices -- one to Mercury, one to Jove, and one to Athene -- for their assistance in his battles against Medusa, Atlas, and the sea monster.
Back at Cepheus' palace, Perseus and Andromeda were married. After the happy ceremony, Perseus' father-in-law asked him how he'd gotten the head of Medusa, and so Perseus told the story. He'd stolen the one eye that the Graie sisters, Medusa's guardians, shared between them. Then he'd gone to Medusa's lair and lopped off her head while she slept. He never looked directly at Medusa's head, but in order to see her, he looked at her reflection in his bronze shield. Out of the blood that poured from her body when Perseus beheaded her sprung Pegasus and his human brother, Chrysaor.