In Hamlet, introducing the ghost of the young Hamlet's father, also Hamlet, allows Shakespeare to develop the plot somewhat before the ghost's real purpose is revealed. It would have been quite feasible to an Elizabethan audience that a ghost could share the stage with the other characters.
Marcellus and Bernardo are tasked with ensuring that the imminent military strike expected from Norway does not catch Denmark unawares. They have seen an apparition twice while they have been on duty and, in Act I, scene 1, they are searching for confirmation that it is not "but our fantasy" (I.i.23). Horatio is a good choice to corroborate their story as he is both a learned man, a scholar, and a friend of Hamlet's. Fortunately, Marcellus has brought Horatio with him, although Horatio is skeptical and does not expect the ghost to appear.
While Marcellus is recounting the previous night's occurrences and the vision of the ghost, the ghost does actually come before them. Bernardo is anxious to confirm that it looks "like the King that's dead" (41). Horatio watches the apparition which he says, "harrows me with fear and wonder" (44). He is prompted by Marcellus, who is anxious that Horatio should speak to it because it has not spoken to Bernardo and Marcellus and they believe that perhaps it will speak to a more educated man.
Horatio does address the ghost, commenting on its likeness to the late king, "buried Denmark" (48), and on its "warlike form"; the "form" that will most mislead the characters and the audience in questioning the motives of the ghost. They all assume that the ghost has military motives and not personal ones.