The beginning of Vayetze describes Yaakov's going to sleep with a stone or stones at his head. I've heard that a midrash says that various stones argued over which of them would be under his head, and that God merged them into one stone that could be under Yaakov's head. I can think of three scenarios; which occurred?
Yaakov put them all at his head and went to sleep. They got merged afterward.
Yaakov put them all down for his head, including one that his head would actually rest on. They argued over which should be under his head, and got merged. Then he went to bed.
Yaakov went looking for a stone to put his head on. A bunch of stones wanted to be chosen, argued, and got merged, and Yaakov chose the resulting stone.
This midrash appears in the Bavli, Chulin 91 amud 2. (Midrash Raba 68 discusses the stones' merging, but not their argument.)
Rashi on Chumash and Maharsha on Chulin say that Yaakov made a sort of headrest out of the stones, including a stone for under his head and some more for around his head, and then the stones argued. That would accord with either of the first two of the three options in the question. The L'vush on Rashi says that Yaakov made the headrest, "and, afterward, they became one stone via a miracle that night", which sounds to me like the transformation happened after Yaakov had gone to bed, the first option in the question.
The Ben Y'hoyada on Chulin says that Yaakov chose to rest his head on the merged stone. That would accord with either of the last two of the three options in the questions.