There are several explicit messages. First the ghost tells Hamlet that he is "thy father's spirit." That may not seem like a big deal, but Hamlet and the other men are very scared of this ghost that is coming to talk to Hamlet. He can be somewhat assured that the ghost is the ghost of his father, and not some aberration. The next message is that the ghost is stuck in purgatory. This is important later when Hamlet doesn't kill Claudius in the act of prayer for fear that Claudius would not go to a fate as bad or worse than what his father suffers in now. The most important explicit message is how Claudius poisoned King Hamlet and the King's request of Hamlet to seek revenge. He also explicitly says to not punish Gertrude for her marriage to Claudius.
The implicit message is that Hamlet must do as his father as requested. He must keep all this secret and take action against the corruption of the Danish throne.
We immediately feel more sorry for Hamlet because this seems like a huge task, and we, like Hamlet, are not 100 percent sure we should trust this ghost in the first place. We do want to believe the ghost, and having King Hamlet come back from the dead to tell the horrible details of death makes his murder all the more poignant.
Hamlet quickly moves from being a witty yet very melancholy character to what seems to be a man with a mission. He speaks with great energy and drive when he says that he will wipe all other thoughts from his brain, "and thy commandment all alone shall live / Within the book and volume of my brain."
When Hamlet sees his father's ghost who tells him that he was murdered by Claudius and seek revenge on Claudius (the explicit message), we start to unravel the complexities of Hamlet's character. Much like a modern detective or crime scene investigator, he is unsure of his evidence and will not act without knowing his father's cause of death for certain. Since he has no crime lab, he must rely on emotional evidence, so he pretends to be mad so people speak freely in front of him.
Whether or not he actually becomes mad in the process is a subject of great debate, but there's no question that he had a melancholy and sometimes excitable air before all this began. After his father's ghost appears, these traits deepen along with a serious misogynistic bent as well (which is part of the implicit message - women are not to be trusted). All of these things contribute to Hamlet's downward spiral that contributes to the major bloodbath that takes down many others besides simply Claudius, which was his father's instruction.
Hamlet is often a sympathetic character to the audience, until he unravels to the point that he takes other characters besides Claudius down with him which is why the play must end as it does.