Jacob's dream is presented in Genesis 28:11-19. Let's take a look at how the hymn's lyrics match up with the story.
By this time, Jacob is on the run from his twin brother, Esau, who vowed to kill Jacob for taking his birthright and stealing his blessing from their dying father.
Though like the wanderer, the sun gone down,
Darkness be over me, my rest a stone;
Yet in my dreams I'd be nearer, my God, to Thee.
As he settles down to rest on his journey, he dreams of a ladder coming down from heaven with angels ascending and descending upon it.
There let the way appear, steps unto Heav'n;
All that Thou sendest me, in mercy giv'n;
Angels to beckon me nearer, my God, to Thee..
God appears and promises the land around him will belong to Jacob and his descendants. "Behold, I am with you and will keep you wherever you go, and will bring you back to this land; for I will not leave you until I have done that of which I have spoken to you," He says. When Jacob awakens, he names the land Bethel, meaning House of God.
Then, with my waking thoughts bright with Thy praise,
Out of my stony griefs Bethel I'll raise.
So by my woes to be nearer, my God, to Thee.
While there are many interpretations of Jacob's Ladder, many Christian scholars believe the ladder represents Jesus Christ as the connection between man and God, citing John 1:51: "And he [Jesus] said to him, 'Truly, truly I say to you, you will see heaven opened, and the angels of God ascending and descending on the Son of Man.'"
There in my Father's home, safe and at rest,
There in my Savior's love, perfectly blest;
Age after age to be nearer, my God, to Thee.