I'm only speculating but I think Melisandre may have set Stannis up all along. I think she calculated the entire disaster. Burning Stannis' daughter so his army had no hope (after half deserted), but still would be able to march forward to their deaths. I feel this way because what interest does Melisandre actually have in Stannis claiming the throne? Well, none. She's a religious fanatic, and she wants to resurrect Jon Snow as Azor Ahai. He won't have to worry about losing his spirit (which does happen when reviving people with fire magic according to Thoros of Mir), because he could have warged into Ghost (which I believe all Starks can do) to keep his spirit alive while his body was dead, which may have to do with why Ghost wasn't there.
I think after he's revived, his already rare/special sword becomes a flaming rare/special sword, he goes back to claim Dragonstone (Stannis' old city) where dragon glass to kill the white walkers is in a heavy abundance, with a wildling army, and Sam Tarly & the wildling girl and child.
Things that suggests this happens?
- Well, first, she led Stannis' army to a complete rout, and took care of him, and she headed back to Castle Black at a rather opportune time.
- She says that Azor Ahai will be reborn amidst the salt and smoke (in the chapter with Jon Snow's death, in the book, his attack is described as smokings wounds, with his Night's Watch attackers crying salty tears as they're stabbing him).
- She looks into the fire and says "I pray for a glimpse of Azor Ahai, and R’hllor shows me only Snow."
- Also validating the Jon's-spirit-goes-into-Ghost theory is a vision Melisandre has while looking into her flames:
"The flames crackled softly, and in their crackling she heard the whispered name Jon Snow. His long face floated before her, limned in tongues of red and orange, appearing and disappearing again, a shadow half- seen behind a fluttering curtain. Now he was a man, now a wolf, now a man again."
- it should also be noted that in the book, before he (or his body at least) dies, he says "Ghost", which may be him attempting to warg into Ghost.