How do you think a director in Shakespeare’s time might solve the problem of staging a ghost?
If we read the text of the ghost scenes carefully, I think we can piece together that Shakespeare rather neatly sidesteps the need for any special effects.
In Act 1, Scene 1, Bernardo remarks that the ghost comes 'in the same figure like the King that's dead' - that the ghost, in short, looks exactly the dead King used to look. It is, Horatio later mentions, a 'fair and warlike form'. If its form is 'fair', there's no rotting flesh, no zombie eyes: what's freaky about this ghost is that it's so instantly familiar, but that the person it looks like is dead and buried.
Horatio reiterates this later on, before providing us with some useful further information:
HORATIO: As thou art to thyself.
Such was the very armour he had on
When he the ambitious Norway combated.
The ghost, in short, wears a full suit of armour: you can't see his body. And the characters helpfully point out that this suit of armour is one that King Hamlet used to wear. Again, there's no white sheets: Shakespeare provides the solution within the text.
Finally, there would have been a trapdoor in the stage which scholars think that the ghost would have used for his cries of 'Swear' in Act 1, Scene 5 from under the stage (Hamlet compares him to a mole, burrowing under the earth). However, the 'crane' stage machinery is believed not to have been installed in the Elizabethan theatre until long after Shakespeare wrote Hamlet.
When studying the stage of the Globe theater and others like it during Shakespeare's time, we know that one main difference is that they did not have a huge curtain that was closed between each scene allowing for set changes, etc. Also, we notice the trapdoor in the center of the floor which juts out into the audience. It was accessible from underneath, and was often used to store small props that would be needed by actors on stage.
Actors could also "appear" suddenly from above the stage by the use of winches and ropes, or creatively arranged curtains.
As with movies today, the actual method used to present the ghost in Hamlet would depend on the director's point of view and interpretation of the action.
When the Shakespeare's Globe Theatre was rebuilt after the fire, it was improved with a flying chair, a trap door, and other features, so I imagine that the simplest way to present King Hamlet's ghost would be to position a battlement in front of the trap door and allow him to appear and later disapear via the trap door.