This was figured in Jacob’s placing a stone at his head, and so sleeping. The patriarch Jacob had placed a stone at his head: sleeping with that stone at his head, he saw heaven opened, and a ladder from heaven to earth, and Angels ascending and descending; after this vision he awaked, anointed the stone, and departed. In that “stone” he understood Christ; for that reason he anointed it. Take notice what it is whereby Christ is preached. What is the meaning of that anointing of a stone, especially in the case of the Patriarchs who worshipped but One God? It was however done as a figurative act...: and he departed. For he did not anoint the stone, and come to worship there constantly, and to perform sacrifice there. It was the expression of a mystery; not the commencement of sacrilege. And notice the meaning of “the stone.” “The Stone which the builders refused, this is become the head of the corner.” Notice here a great mystery. The “Stone” is Christ. Peter calls Him “a living Stone, disallowed indeed of men, but chosen of God.” And the stone is set at “the head,” because “Christ is the Head of the man.” And “the stone” was anointed, because “Christ” was so called from His being anointed. And in the revelation of Christ, the ladder from earth to heaven is seen, or from heaven to earth, and the Angels ascending and descending. What this means, we shall see more clearly, when we have quoted the testimony from the Lord Himself in the Gospel.
Source: Exposition on Psalm 45