וַיִּפְגַּ֨ע בַּמָּק֜וֹם וַיָּ֤לֶן שָׁם֙ כִּי־בָ֣א הַשֶּׁ֔מֶשׁ וַיִּקַּח֙ מֵאַבְנֵ֣י הַמָּק֔וֹם וַיָּ֖שֶׂם מְרַֽאֲשֹׁתָ֑יו וַיִּשְׁכַּ֖ב בַּמָּק֥וֹם הַהֽוּא׃
וַיַּשְׁכֵּ֨ם יַעֲקֹ֜ב בַּבֹּ֗קֶר וַיִּקַּ֤ח אֶת־הָאֶ֙בֶן֙ אֲשֶׁר־שָׂ֣ם מְרַֽאֲשֹׁתָ֔יו וַיָּ֥שֶׂם אֹתָ֖הּ מַצֵּבָ֑ה וַיִּצֹ֥ק שֶׁ֖מֶן עַל־רֹאשָֽׁהּ׃
For students of Rashi's commentary on the Torah, these verses evoke the image of Jacob's quarreling stones. According to the rabbinic tradition Rashi cites, each stone demanded, "upon me let this righteous man lie his head," until God made peace among them by fusing them together (Rashi, Gen. 28:11 following Bereshit Rabba and Hulin 91b).
A memorable story by itself -- with an echo of long-forgotten Israelite mythology -- this midrash is also an affecting metaphor for the unification of the twelve tribes under the banner of their forefather Jacob (according to a variation on this story, twelve stones merged into one -- the symbolism is stated explicitly in Bereshit Rabba and Pirke Rabbi Eliezer).
The peshat-oriented exegetes (e.g., Rashbam, Ibn Ezra, Bekhor Shor), of course, don't feel bound to read מֵאַבְנֵ֣י הַמָּק֔וֹם as multiple stones; Jacob took only one stone, they say, of many in the area. (Interestingly, the King James Version translation agrees with Rashi: "and he took of the stones of that place, and put them for his pillows, and lay down in that place to sleep.")
Why would the Torah go out of its way to tell us about an apparently random rock? Because of its special destiny. After sleeping beside it, and awaking from his famous dream, Jacob dedicates the rock as a מצבה (a stele or monument), anoints it with oil (an act of consecration) and vows that upon his safe return from Haran he will sacrifice thanksgiving offerings to God in that very spot, the site of a future temple.
But why did Jacob need a stone in the first place? וַיָּ֖שֶׂם מְרַֽאֲשֹׁתָ֑יו may seem to suggest he wanted to prop up his head on a stone pillow. And on one level, this makes sense. Jacob later says that he escaped from Esau carrying only his walking stick (Gen. 32:10). While this may be poetic hyperbole, Jacob would certainly not have had time to pack unnecessary belongings like cushions or extra garments to pad his campsite. A pillow of stone befits his desperate and spartan condition at the time.
Still, the word מְרַאֲשׁוֹת in the Bible doesn't always, or possibly ever, mean "under the head." Instead, it appears to mean "beside the head." The biblical usage includes, for example, the following (I Samuel 26:7, 11-12): וַחֲנִית֥וֹ מְעוּכָֽה־בָאָ֖רֶץ מְרַאֲשֹׁתָ֑יו -- "his spear stuck in the ground at his head" -- certainly not under his head! (see also Mandelkern's Concordance, p. 1065, which defines מְרַאֲשׁוֹת as "the opposite of מַרְגְּלֹתָיו," the latter meaning at the legs, rather than under the legs).
The most likely explanation is that Jacob took his stone, or stones, for warmth. Ancient travelers sleeping outside in the cool night air, especially in the desert, could take advantage of the heat that radiates, well into the night, from sunbaked rocks. Jacob may have also deliberately avoided lighting a fire at night so as not to draw attention from Esau and his men who, he would have feared, were already pursuing him.
If so, then the Midrash, rather than the peshat commentaries, may have gotten it right after all. For maximum radiant heat, Jacob would no doubt have gathered as many large stones as he could.
Jacob's descendants, an imperfect union of often warring tribes, are fortunate that those honor-hungry, self-centered stones ultimately, if involuntarily, made peace with each other.