Why did Jacob bury Rachel along the roadside in Bet-Lechem, and not in Hebron like the other matriarchs? Because he foresaw that in the future the Jews would pass by Bet-Lechem on their way to being exiled. Jacob wished that Rachel would sense their anguish and pray for them.
It happened 1,000 years later that the Jews put an idol into the Holy Temple, and God sought to destroy it forever. The souls of each of the forefathers and foremothers pleaded to God to spare the Jews from permanent exile. In exchange for God's promise, they offered all their merits: their faith, their devotion and their self-sacrifice. Abraham tried to prevail over God in the merit of having brought monotheism to the world. But God said that would not suffice. Then Isaac pleaded with God in the merit of his willingness to be sacrificed on Mount Moriah. But that too was rejected as insufficent. Jacob, Moses and others presented their merits. But none would suffice.
Rachel's soul then presented itself before God. "Master of the Universe," she began, "I waited seven years to marry my beloved Jacob. When the time of the wedding finally came, my father schemed to switch me with my sister Leah. Jacob suspected this would happen, so together we made up a password. But I realized that Leah would be put to shame if the scheme were uncovered, so I had compassion for my sister and gave her the password. I overcame my own feelings and was not jealous. I allowed a competitor into my home. So if I was able to do it, God, then all the more so You too should not be exacting of the idol -- the competitor in Your home."
Immediately, God's compassion was aroused. He said, "Don't cry over the exile, Rachel, because for your sake I will in the future return the children of Israel to their homeland once again."
From Jeremiah 31, Midrash Genesis Rabba 82:10, and Pesikta Eichah Rabbasi 24