A lot of people say that since Jon was a worg (a trait that runs strong in the Stark bloodline), and his bond with Ghost was so strong, that his soul went to Ghost right before his death. And since not too much time has past and his bond with Ghost was so deep that he might be able to come back with little loss.