Before the play even begins, we find that the Ghost has appeared to some of Hamlet's friends, without speaking. The characters in Act I, scene i are agitated and have summoned Hamlet to come and see. The Ghost appears twice onstage, wordlessly, before he appears to Hamlet. The mere existence of a Ghost would create great suspense for a superstitious Elizabethan audience. His wordless appearances serve to build the anticipation.
Prior to the opening of the play, Hamlet's father, the King of Denmark, has been assassinated, but no one knows the identity of the murderer. The king's brother, Claudius, has married Hamlet's mother and taken over the throne.
Shakespeare was a master at building dramatic suspense and never more so than in this iconic opening to Hamlet. First, the setting is a castle watch late on a dark night--suitably creepy. Then, just as we are starting to hear about the appearance of the ghost for two nights running, the ghost itself appears. We see it and are told it looks like the dead king, Hamlet, but when Horatio demands that it speak, it disappears. We the audience want to know more. Horatio, though he doesn't know what the ghost's appearance means, says he fears it is a bad omen for Denmark, again building our anxiety. Horatio then amplifies our fear and suspense out there on the dark ramparts, where the ghost has just passed, by telling what we might call "ghost stories": stories of supernatural happenings such as corpses rising from their graves right before Julius Caesar was killed, again building fear that something terrible is about to happen. At this point, our nerves taut, we see the ghost again! The guards demand that it speak, but it jumps around from place to place. Before it can say anything, the cock crows to announce dawn and the ghost vanishes. By this point, we very much want to know what is going on with that ghost.
Adding to our sense of unease are the reports woven throughout this scene of Denmark preparing for war with Norway. Marcellus wonders why the ship makers are working around the clock without a break. Horatio tells him that the dead king Hamlet had killed Fortinbras and now Fortinbras's son is amassing an army to march on Denmark and take revenge. Thus, from the start, both portents of war and supernatural sightings of a ghost build our sense of unease.