How does Hamlet react when the ghost beckons to him?
In Act I, Scene iv of Shakespeare's The Tragedy of Hamlet, Prince of Denmark, the ghost appears to Hamlet, Horatio, and Marcellus just before midnight on a cold night. Horatio notices the ghost before Hamlet does, having predicted its arrival, and Hamlet's first reaction is an urgent need to speak with the ghost, no matter its intentions and no matter what danger he might encounter by engaging with the ghost in such an open way.
Secondly, perhaps because the ghost reminds Hamlet of his father, Hamlet reacts to the ghost with trust, agreeing to follow the ghost when it beckons without any hesitation. Horatio tries to warn Hamlet not to be so trusting, but Hamlet's response is to minimize his own life and the danger he might be in. When Horatio and Marcellus try to hold Hamlet back physically, their efforts are futile, as Hamlet's need to go with the ghost and his trust of the ghost overpower any fear he might be experiencing.
Before the ghost beckons Hamlet, he is, of course, overwhelmed and full of questions. He tells the ghost that since he (ghost) has the appearance of his father ("a questionable shape"), he will speak to it no matter what.
Horatio and Marcellus warn Hamlet not to follow the ghost. Hamlet wants to hear the ghost speak; he is determined to hear it speak. In addition to this determination, he's also in a bold state of mind. Still grieving for his father and distraught by his mother's hasty marriage to Claudius, he feels like he has nothing to lose by following the ghost:
Why, what should be the fear?
I do not set my life at a pin's fee;
And for my soul, what can it do to that,
Being a thing immortal as itself?
It waves me forth again. I'll follow it. (I.iv.70-74)
Despite further warnings from Horatio and Marcellus, Hamlet is determined to follow the ghost, claiming it is fate (end of Act 1, Scene 4).
Here is a theatrical version of the scene you are referencing: