There's an ancient prophecy central to both the Game of Thrones TV show and the Song of Ice and Fire books that describes a last battle of good versus evil.
In Chapter 10 of A Clash of Kings, the prophecy is laid out like this:
There will come a day after a long summer when the stars bleed and the cold breath of darkness falls heavy on the world. In this dread hour a warrior shall draw from the fire a burning sword. And that sword shall be Lightbringer, the Red Sword of Heroes, and he who clasps it shall be Azor Ahai come again, and the darkness shall flee before him.
And in a special feature on the Blu-ray of Season 3 of Game of Thrones, Thoros of Myr describes the same Azor Ahai prophecy like this:
On one side is the Lord of Light — the heart of fire, the god of flame and shadow. Against him stands the Great Other, whose name may not be spoken: the lord of darkness, the soul of ice, the god of night and terror. According to prophecy, our champion will be reborn to wake dragons from stone and reforge the great sword Lightbringer that defeated the darkness those thousands of years ago. If the old tales are true, a terrible weapon forged with the lifeblood of a loving wife's heart. Part of me thinks man was well rid of it, but great power requires great sacrifice. That much, at least, the Lord of Light is clear on.
There are some clear details that stay consistent:
• A prince named Azor Ahai appeared at a moment of great darkness.
• He had a flaming sword called Lightbringer.
• The sword was forged in a loving wife’s blood.
• Azor Ahai then used that sword to defeat the "Great Other."
• Then a prophecy called "The Prince Who Was Promised" was written in high Valyrian.
• It says that Azor Ahai would one day return.
• He would be born from the line of House Targaryen.
• And he would once again wield Lightbringer to conquer the darkness.
The character most obsessed with "The Prince Who Was Promised" is Melisandre, the Red Witch.
And Melisandre eventually adds some more details to the Azor Ahai myth:
• He appears after a long summer, when the stars bleed and the cold breath of darkness falls heavy on the world.
• He shall be born again amidst smoke and salt.
• He shall wake dragons out of stone.
She then convinces Stannis Baratheon that he's the Prince Who Was Promised. His grandmother is a Targaryen, so the lineage checks out. The rest of the details don't line up so well, though.
He gets a flaming sword and he names it Lightbringer. Then he spends most of Game of Thrones pretty convinced he's Azor Ahai.
Except, whoops, he wasn't. And then he dies (probably...it happened off camera, and with this show, who the heck knows). Sorry, Stannis, better luck next time.
We also learned at Dragonstone this season that apparently in High Valryian, "prince" is a gender-neutral term. Which means Dany could fulfill the prophecy.
Dany makes a little more sense as the Prince(ss) Who Was Promised.
There's also the possibility that Jon Snow is Azor Ahai. Aside from the whole resurrection thing, there are more than a few similarities between the Prince Who Was Promised and Jon.
And Jon is probably a Targaryen. It was revealed in Season 6 that he's likely the lovechild of Rhaegar Targaryen and Lyanna Stark. And he was born under a "bleeding star."
As young Ned Stark takes what we assume to be baby Jon from Lyanna at the Tower of Joy, she bleeds to death under the hilt of a sword called Dawn, a famous ancestral greatsword of House Dayne, believed to have been forged from a falling star.
And as far as Lightbringer, well, Jon Snow's sword is called Longclaw, but it's made of Valyrian steel, which is forged with dragon fire.
If you go through the Westerosi version of the Prince Who Will Be Promised prophecy, it has a few weird differences. It's described by Old Nan early on in Game of Thrones.
She says the Last Hero is someone who set out into the dead lands, lost his friends one by one, watched his horse and dog die, and then snapped his blade when he tried to use it.
The last hero determined to seek out the children, in the hopes that their ancient magics could win back what the armies of men had lost. He set out into the dead lands with a sword, a horse, a dog, and a dozen companions. For years he searched until he despaired of ever finding the children of the forest in their secret cities. One by one his friends died, and his horse, and finally even his dog, and his sword froze so hard the blade snapped when he tried to use it.