In Act I, Scene 1, ofHamlet, Bernardo arrives to relieve Francisco. They are on watch outside Elsinore, the castle of the Danish King (Claudius, and formerly, Old Hamlet). This is a typical watch but anxieties might be heightened because of the possible war with Norway. Prior to the action in the play, when Old King Hamlet was alive, Fortinbras' father (then the King of Norway) lost his life and certain lands in battle with Old King Hamlet. Horaito indicates that this threat of war is the reason they are on watch:
So by his father lost. And this, I take it,
is the main motive of our preparations,
The source of this our watch and the chief head
Of this post-haste and romage in the land. (I.i.118-121)
Francisco departs, leaving Marcellus, Horatio and Bernardo. Marcellus asks Bernardo if he's seen the ghost. This indicates that they've seen the ghost before. Then, they debate whether the ghost is really Old King Hamlet and whether it is a sign of impending war with Norway or something else. The ghost just appears periodically and wanders without speaking. They try to speak to it and even try to attack it. Horatio decides they should inform Hamlet to see if it will speak to him.
At the end of Act 1, Scene 2, Marcellus and Horatio tell Hamlet about the ghost. In Scene 5, the ghost reveals he is Hamlet's father's spirit and asks for revenge.
This is actually interesting how Shakespeare develops the Ghost into a real character. The other characters on stage, first Marcellus then Horatio, are trying to tell us the back story to Hamlet but it is done in the manner of a ghost story told on a dark and spooky night. Only here the ghost actually shows up. This not only emphasizes the power of theater over story-telling, it gives substance to what is otherwise an apparition. The story serves to give us the audience shape and depth to the Ghost.
In fact this stands in contrast to the next scene where we are presented with the image of a "real" king in the form of Claudius. Claudius has summoned all his regal finery for us and his inner or stage audience before whom he "performs" his kingly duties. As Act One plays out we begin to see that the Ghost is more real than Claudius is. What I mean by that is the Ghost takes on an image of truth, i.e., a believability, as Claudius's believability as a king slips.