The Jataka, Vol. II, tr. by W.H.D. Rouse, , at sacred-texts.com
 "Gagga, live an hundred years," etc.--This story the Master told when he was staying in the monastery made by King Pasenadi in front of Jetavana; it was about a sneeze which he gave.
One day, we are told, as the Master sat discoursing with four persons round him, he sneezed. "Long life to the Blessed One, long life t' the Buddha!" the Brothers all cried aloud, and made a great to-do.
The noise interrupted the discourse. Then the Master said to the Brethren: "Why, Brothers, if one cry 'Long life!' on hearing a sneeze, does a man live or die any the more for that?" They answered, "No, no, Sir." He went on, "You should not cry 'Long life' for a sneeze, Brethren. Whosoever does so is guilty of sin."
It is said that at that time, when the Brethren sneezed, people used to call out, "Long life to you, Sir!" But the Brethren had their scruples, and made no answer. Everybody was annoyed, and asked, "Pray, why is it that the priests about Buddha the Sakya prince make no answer, when they sneeze, and somebody or other wishes them long life?"
All this was told to the Blessed One. He said: "Brethren, common folk are superstitious. When you sneeze, and they say, 'Long life to you, Sir!' I permit you to answer, 'The same to you'." Then the Brethren asked him--"Sir, when did people begin to answer 'Long life' by 'The same to you'?" Said the Master, "That was long, long ago;" and he told them a tale of the olden time.
Once upon a time, when Brahmadatta was king of Benares, the Bodhisatta came into the world as a brahmin's son of the kingdom of Kāsi; and his father was a lawyer by calling. When the lad was sixteen years old or so, his father gave a fine jewel into his charge, and they both
travelled through town after town, village after village, until they came to Benares. There the man had a meal cooked in the gatekeeper's house; and as he could find nowhere to put up, he asked where there was lodging to be had for wayfarers who came too late? The people told him that there was a building outside the city, but that it was haunted; but however he might lodge there if he liked. Says the lad to his father, "Have no fear of any goblin, father! I will subdue him, and bring him to your feet."  So he persuaded his father, and they went to the place together,
The father lay down upon a bench, and his son sat beside him, chafing his feet.
Now the Goblin that haunted the place had received it for twelve years' service of Vessavaṇa 1, on these terms: that if any man who entered it should sneeze, and when long life was wished him, should answer, "Long life to you!" or "The same to you!"--all except these the Goblin had a right to eat. The Goblin lived upon the central rafter of the hut 2.
He determined to make the father of the Bodhisatta sneeze. Accordingly, by his magic power he raised a cloud of fine dust, which entered the man's nostrils; and as he lay on the bench, he sneezed. The son did not cry "Long life!" and down came the Goblin from his perch, ready to devour his victim. But the Bodhisatta saw him descend, and then these thoughts passed through his mind. "Doubtless it is he who made my father sneeze. This must be a Goblin that eats all who do not say 'Long life to you'." And addressing his father, he repeated the first verse as follows:--
The Goblin thought, "This one I cannot eat, because he said 'Long life to you.' But I shall eat his father;" and he came close to the father. But the man divined the truth of the matter--"This must be a Goblin," thought he, "who eats all who do not reply, 'Long life to you, too!'" and so addressing his son, he repeated the second verse:--
 The Goblin hearing these words, turned away, thinking "Neither of these is for me to eat." But the Bodhisatta put a question to him: "Come, Goblin, how is .it you eat the people who enter this building?"
"I earned the right for twelve years' service of Vessavaṇa."
"What, are you allowed to eat everybody?"
"All except those who say 'The same to you' when another wishes them long life."
"Goblin," said the lad, "you have done some wickedness in former lives, which has caused you to be born now fierce, and cruel, and a bane to others. If you do the same kind of thing now, you will pass from darkness to darkness. Therefore from this time forth abstain from such things as taking life." With these words he humbled the Goblin, scared him with fear of hell, established him in the Five Precepts, and made him as obedient as an errand-boy.
Next day, when the people came and saw the Goblin, and learnt how that the Bodhisatta had subdued him, they went and told the king: "My lord, some man has subdued the Goblin, and made him as obedient as an errand-boy!" So the king sent for him, and raised him to be Commander-in-Chief; while he heaped honours upon the father. Having made the Goblin a tax-gatherer, and established him in the Bodhisatta's precepts, after giving alms and doing good he departed to swell the hosts of heaven.
When the Master had ended this story, which he told to explain when the custom first arose of answering 'Long life' by 'The same to you,' he identified the Birth: "In those days, Ānanda was the king, Kassapa the father, and I myself was the lad his son."
11:1 The introductory story is repeated in the Cullavagga, v. 33 (iii. 153 of Rhys Davids' translation of Vinaya Texts in the S. B. E.).
12:1 A monster with white skin, three legs, and eight teeth, guardian of jewels and the precious metals, and a kind of Indian Pluto.
12:2 See Eggeling, Çatap.-Brāhm. vol. 2, p. 3, S. B. E., for the construction of the hut.