After the sacrifice lost its head the gods went on with a headless rite. Dadhyanch Atharvana knew its pure essence, how the head is put on again. Indra told him: teach this to anyone and I cut off your head. The Ashvins heard and asked to be his pupils; he was afraid. They promised protection: we shall cut off your head and put it aside, fetch a horse's head and put it on you; with that you teach us; Indra will cut that off, and we shall put your own back. So it was done. The text quotes RV 1.116.12 and rules that the teaching may be given only to a known pupil who has lived a year with the teacher.
Kakshivat proclaims, as thunder announces rain, the deed by which Dadhyanch son of Atharvan told the twins of the honey through a horse's head (1.116.12); the Ashvins brought the horse's head and gave it to him, and he revealed the sweet thing, 'Tvashtri's secret' (1.117.22); they drew his spirit to themselves and the horse's head spoke to them (1.119.9).
What is different here:
No Indra, no threat, no beheading and no restoring of the human head; the honey is linked to Soma and Tvashtri.
The Upanishad sets out the 'honey doctrine': earth, water, fire and the rest are each honey to all beings and all beings honey to them, and the same bright person is in each and in the body; that is the Self. It then says four times that Dadhyanch Atharvana proclaimed this honey to the two Ashvins, quoting RV 1.116.12 and 1.117.22.
What is different here:
The honey is knowledge of the Self, not a ritual secret; the story is assumed, not retold.
Indra, pleased, first gave Dadhyanch the spell and then forbade him to speak of the honey on pain of death. The Ashvins asked for it in secret; told of the threat, they proposed the horse's head, saying Indra would not kill him for that. He taught them; Indra took off the horse's head; they put his own back. The severed horse's head fell into a lake on Mount Sharyanavat, rises from the water bestowing boons and lies there to the end of the age. RV 1.84.13-14 says Indra sought the horse's head in the mountains, found it at Sharyanavat, and with the bones of Dadhyanch slew ninety-nine foes.
What is different here:
Indra is the source of the secret; adds the fate of the horse's head; links the tale to the bones used as a weapon.
When the gods need a weapon against Vritra, Vishnu sends them to Dadhyanch, 'also known as Dadhichi', recalling that he gave the Ashvins the knowledge through a horse's head, whence the mantras are called Ashvashira, and saying the Ashvins should be the ones to ask for his body.
What is different here:
Identifies Dadhyanch with the Dadhichi of the thunderbolt story; the Ashvins become the go-betweens who ask for his bones.
Jaiminiya Brahmana variant (as summarised on Wikipedia)
Pan-IndiaAll traditions
Wikipedia's article on Dadhichi reports a Jaiminiya Brahmana form in which the gods declare that whoever reveals the Ashvashira teaching to the twins will have his head burst, and the sage asks the Ashvins for the horse-head exchange to escape that fate.
What is different here:
A curse of the gods in place of Indra's sword. Not read in the Brahmana itself; unverified and not used in the published story.
Sources: The Satapatha-Brahmana, tr. Julius Eggeling (Sacred Books of the East 12, 41); Hymns of the Rigveda, tr. R. T. H. Griffith (1896), hymns read for the Vedic layer; The Upanishads, tr. F. Max Muller (Sacred Books of the East 1 and 15); The Brhad-devata attributed to Saunaka, ed. and tr. A. A. Macdonell (Harvard Oriental Series 6); Srimad-Bhagavatam (Bhaktivedanta Vedabase); Wikipedia: Dadhichi