The great sages Vashishtha and Vishwamitra once made a bet. Vashishtha asserted that King Harishchandra of the Solar (Ikshvaku) Dynasty was the epitome of truthfulness, while Vishwamitra said he could easily make Harishchandra lie. So Vishwamitra set out to test the king.
He arrived at Harishchandra's court and requested a handsome sum of money for his yagya. Harishchandra was ready to pay the sum immediately, but Vishwamitra said he would accept it when the time had come. Using his yogic powers, Vishwamitra created two apsaras. At his behest, the apsaras tried to seduce Harishchandra, but the king resisted their advances, saying that he was already married to Queen Taramati.
A furious Vishwamitra stormed into Harishchandra's court. "Either marry my girls or relinquish the throne," he demanded.
Following dharma, Harishchandra chose the latter option. He took off his crown, jewels, and royal garments and began heading out of the palace with Taramati and their young son, Rohitashwa. Just then, Vishwamitra reminded Harishchandra about his promise to pay for the sage's yagya. Harishchandra had already forfeited his royal fortune, but vowed to earn the money and pay. Vishwamitra sent Nakshatrika along with the former king and his family to collect the debt.
To earn the money, Harishchandra and his family had to face numerous trials. It was often suggested to Harishchandra that he default on the debt, as it had no legal witnesses or documentation, but he would not swerve from the path of truth. He sold Taramati as a maidservant to Pandit Ramlal and his wife. At Harishchandra's request, Ramlal agreed to let young Rohitashwa stay with Taramati while she worked at his house. The money Harishchandra obtained by selling Taramati wasn't enough, so he sold himself as a slave to a chandala (cremation ground keeper) named Veerabahu. Harishchandra was tasked with cremating the dead after collecting tax from the one who brought the body.
One day, Pandit Ramlal told Rohitashwa to gather some flowers for a puja. The boy promptly went to the garden, greeted the woman gardener, and began to pick flowers. A little later, the gardener was shocked to find him lying on the ground, foaming at the mouth. At Vishwamitra's command, a poisonous snake had bitten him. She immediately went home and informed Taramati. Taramati rushed to her son's aid, but it was too late; Rohitashwa lay dead amid the grass.
"O God!" she lamented. "How can you be so heartless as to take my only son away from me?"
There was nothing left for her to do but to cremate her son. With a heavy heart, she carried his body to a crematorium—the very crematorium overseen by her husband. Harishchandra saw Taramati approaching him with a corpse. They had changed so much after parting ways that they did not recognize each other. He demanded that she pay the tax first.
"Tax? But I have nothing with me. How can I possibly pay the tax?" she said.
"That's the rule, and it applies to everyone—rich or poor. I cannot go against my master, Veerabahu."
"Veerabahu? That means you ... you're Harishchandra?"
Harishchandra was surprised she knew his name.
"It's me, Tara," she wept.
Harishchandra's whole world came crashing down around him. "If you're Tara, is this ... is this Rohita?
"Yes, my lord."
Vishwamitra (1989 Hindi TV series) by Dasari Narayana Rao.
Satyavadi Raja Harishchandra (Hindi Kindle book) by Gopi Krishna Kunwar