Izanagi (He Who Invites) and Izanami (She Who Invites) were the eighth pair of primeval Kami (deities) and were tasked with creating the world.
They were given a heavenly jeweled spear to aid them in their endeavor, and standing on the Floating Bridge of Heaven they dipped the end in and stirred that waters of chaos below until the waters started to thicken:
So the two Deities, standing upon the Floating Bridge of Heaven, pushed down the jewelled spear and stirred with it, whereupon, when they had stiffed the brine till it went curdle-curdle – The Kojiki, translated by Basil Hall Chamberlain
As they pulled the spear from the waters the end began to drip and formed a mound, the first land mass, the island of Onogoro. Izanagi and Izanami descended from the heavens and built themselves a palace on the island. The divine couple had a child together, Hiruko, but the child was deformed, so they put him on a raft and let him float out into the ocean.
Realizing that the couple had made a mistake in their courtship ritual, they tried again and this time were successful. The couple gave birth to many children, the islands first, and then all the elements that gave them shape; the wind, the trees, the sea foam among many. Finally Izanami, birthed fire, an act that scorched her genitals to such an extent that she couldn’t survive. In her final act of dying she birthed sorrow and sadness as her body expired.
Izanagi tried his best to save his beloved sister and consort, but was unable; she left him for Yomi (‘the shadowy land of the dead’), the Shinto underworld. Izanagi chased her calling for her to return, but he was too late. Izanami, hiding in the shadows, revealed that she had eaten in the underworld and thus was unable to leave (compare this with the Greek myth of Persephone and Demeter)
“Lamentable indeed that thou earnest not sooner! I have eaten of the furnace of Hades. Nevertheless, as I reverence the entry here of Thine Augustness my lovely elder brother, I wish to return. Moreover I will discuss it particularly with the Deities of Hades. Look not at me!” – The Kojiki, translated by Basil Hall Chamberlain
Izanami entered the palace of the underworld to beg the underworld Gods to grant her leave, asking Izanagi to wait for her, but after waiting an entire day Izanagi grew restless and followed after her. Inside the darkness he used his hair and comb to create a torch and peered into the blackness.
There he saw the body of Izanami, withered and rotting and crawling with maggots. Horrified he fled, angering his sister wife who felt betrayed by his actions. She ran after him accompanied by the foul demon women that inhabited the Underworld, intending to destroy him.
Izanagi was too fast for the demons that chased him, and he escaped Yomi, rolling a giant boulder across to block the entrance, trapping Izanami and all the demons inside. His sister-wife yelled at him in anger.
Izanagi could hear her scream: every day she would strangle 1,000 people and bring them to her domain. They would keep her company, unlike her husband-brother.
He responded in kind: every day he would give life to 1,500 people…
Izanagi ritually cleansed himself to rid the image of the rotting Izanami from his memory.
As he bathed, the Sun Goddess, Amaterasu emerged from his left eye, followed by the Moon God Tsukiyomi, who came out of Izanagi’s right eye.
Finally, the God of the Seas and Storms, Susanoo, emerged from his nostrils
If you’re interested in more, find a translation of the Kojiki, “An Account of Ancient Matters”. This eight century C.E. text is usually considered the oldest extant literary work from Japan, and contains a mixture of myth, folklore and semi-historic accounts, including the creation/underworld/extended creation tale recounted here.
An early online translation by Basil Hall Chamberlain (1919) can be found at sacred-texts.com