Thrown into prison, Thomas prays for his fellow captives and then sings a poem the Acts never names but that readers call the Hymn of the Pearl. A prince, sent from his eastern home by his royal parents to fetch a single pearl guarded by a serpent in Egypt, is given a robe and a token and told he will inherit the kingdom when he returns with it. In Egypt he eats the local food, forgets his royal birth entirely, and falls asleep to the country's customs. A letter from his parents arrives, written as an eagle, and its very words wake him: he remembers who he is, charms the serpent, takes the pearl, and travels home, where the robe he had left behind now fits him as though it had grown with him, and he is greeted as heir.
Nothing in the surrounding narrative refers back to the hymn, and it survives complete in only one Syriac and one Greek manuscript of the Acts rather than in every copy; both facts are why most readers treat it as an older, self-contained poem an editor inserted rather than composed for the occasion. Its allegory, a soul that forgets its origin in the world of matter and is recalled to it by a message from home, is read as more broadly Syrian Christian than narrowly sectarian, and it found a second life among the Manichaeans, who copied and treasured it independently of the Acts that carry it here. Some scholars connect its authorship to Bardaisan of Edessa, a poet and theologian roughly contemporary with the Acts, though this remains a proposal rather than a settled attribution.