Nearly-Headless Nick talks about how he really is his soul, and that when he died he clung on to life so much that he never "passed on". Latter when siruis dies Harry seeks out Nick and askes if there is a chance that sirius is still here on earth as a ghost, and Nick tells him no because someone like sirius would not try to stay here he would move on. The ghosts also have alot of regret as now they are stuck here with no way to move on with their lives or move on to the other side. And the Resurrection ring actually pulls people from the other side back into the world which is why they are "sad" because they are being forced to be basically a ghost on earth again instead of "beyond". though as a side note i believe a ghost could go through that portal in the ministry and probably pass on/ though that is complete speculation.