Theories of how ghosts obtain energy are many and varied. There are as many theories as there are people interested in the subject, or so it seems.
Assuming that ghosts are subject to the thermodynamic laws, and there is no sensible reason to suppose they would not be, then in order for them to do anything - appear, make sounds, move things - they must use energy to do it and therefore must obtain energy by some means.
As far as I know, there is nothing to suggest that ghosts eat, or that they have any form of digestive system. Therefore they don't get energy in the same way as the living. I've wondered about electromagnetic energy, heat energy, even light, although that last one is unlikely because if ghosts obtained energy from light, they'd be more active by day.
Science, as always, sends an inadvertant hint my way. There is a lot of research into harvesting the energy that's loose all around us in the form of electromagnetic waves, vibration and heat to power electronic devices. Such devices would not need external power nor would they need batteries. They'd pick up energy from the environment.
Such mechanisms might hint at how ghosts do it. Although it does open a whole new question:
How much energy does it take to power a manifestation?
Perhaps these devices will give a clue to that, too. How many such devices would reduce a ghost's activity to undetectable? That would tell us how much power that ghost uses.
Of course, we'd first have to work out which form of power we're talking about. Nothing is ever simple.