Buddha says: "At the time of Buddha, there lived an old beggar woman called "Relying on Joy". She used to watch the kings, princes, and people making offerings to Buddha and his disciples, and there was nothing she would have liked more than to be able to do the same. So she went out begging, but at the end of a whole day all she had was one small coin. She took it to the oil-merchant to try to buy some oil. He told her that she could not possibly buy anything with so little. But when he hears that she wanted it to make an offering to Buddha, he took pity of her and gave her the oil she wanted. She took it to the monastery, where she lit a lamp. She placed it before Buddha, and made this wish: "I have nothing to offer but this tiny lamp. But through this offering, in the future may I be blessed with the lamp of wisdom. May I free all beings from their darkness. May I purify all their obstructions, and lead them to enlightenment."
That night the oil in all the other lamps went out. But the beggar woman's lamp was still burning at dawn, when Buddha's disciple Maudgalyayana came to collect all the lamps. When he saw that one was still slight, full of oil and with a new wick, he thought, " There's no reason why this lamp should still be burning in the day time," and he tried to blow it out. But it kept on burning. He tried to snuff it out with his fingers, but it stayed alight. He tried to smother it with his robe, but still it burned on. The Buddha had been watching all along, and said, "Maudgalyayana, do you want to put out that lamp? You cannot. You cannot even move, let alone put it out. If you were to pour the water from all ocean over this lamp, it still wouldn't go out. The water in all the rivers and the lakes of the world could not extinguish it. Why not? Because this lamp was offered with devotion and with purity of heart and mind. And that motivation has made it of tremendous benefit." When Buddha had said this, the beggar woman approached him, and he made a prophesy that in the future she would become a perfect buddha, call "Light of the Lamp."
So it is our motivation, good or bad, that determines the fruit of our actions."