In the below sutta, the Buddha pointed out that the destiny of the dead will be solely decided upon their own conduct while alive, but not by any rituals or rites done by the crowd.
An important point to consider here is that the Buddha didn’t introduce a popular myth of later Buddhism—directing the dead to the heavens via transference of merits—as an alternative to the Brahmanical myth of sending the dead upward by rituals.
Gamini: “Venerable sir, the brahmins of the western region—those who carry around waterpots, wear garlands of water plants, immerse themselves in water, and tend the sacred fire—are said to direct a dead person upwards, to guide him along, and conduct him to heavens. But the Blessed One is able to bring it about that with the breakup of the body, after death, the entire world might be reborn in a good destination, in a heavenly world.”
The Buddha: “Well then, Gamini, I will question you about this. Answer as you see fit. What do you think? Suppose there is a person here
1. who destroys life,
2. takes what is not given,
3. engages in sexual misconduct,
4. speaks falsely,
5. speaks divisively,
6. speaks harshly,
7. chatters idly,
8. one who is covetous,
9. full of ill will,
10. and holds wrong view.”
“Then a great crowd of people would come together and pray, ‘After death, may this person be reborn in a heavenly world.’ What do you think? Because of the prayers, would that person, after death, be reborn in a heavenly world?”
Gamini: “No, venerable sir.”
The Buddha: “Gamini, a person would hurl a huge boulder into a deep pool of water. Then a great crowd of people would come together and pray, ‘Emerge, good boulder! Rise up!’ What do you think? Because of the prayers, would that boulder emerge, rise up?”
Gamini: “No, venerable sir.”
The Buddha: “So, too, Gamini, if a person is one who engages in ten unwholesome deeds, even though a great crowd of people would come together and pray, ‘After death, may this person be reborn in a heavenly world.’ Still, after death, that person will be reborn in hell.”
The Buddha: “If a person is one who abstains from ten unwholesome deeds, even though a great crowd of people would come together and pray, ‘After death, may this person be reborn in hell.’ Still, after death, that person will be reborn in a heavenly world.”
“Gamini, a man submerges a pot of oil in a deep pool of water and breaks it. Then a great crowd of people would come together and pray, ‘Sink down, good oil! Settle, good oil!’ Still, the oil would not sink down or settle? So, too, if a person is one who abstains from ten unwholesome deeds, even though a great crowd of people would come together and pray, ‘After death, may this person be reborn in hell.’ Still, after death, that person will be reborn in a heavenly world.”