The theme of this excellent short story, also entitled "Two Old Men," is expressed rather didactially through Tolstoy's comment at the end of the story when Efim goes to visit Elisha and sees him adopting exactly the same pose of beatific serenity as when he apparently saw Elisha in Jerusalem, even though he realises that Elisha physically wasn't there. Note what Tolstoy tells the reader about what Efim learnt from the experience:
But he now understood that the best way to keep one's vows to God and to do His will, is for each man while he lives to show love and do good to others.
This is of course demonstrated in the example of Elisha and his generosity towards the poor family where he sojourns for a while. Note what Elisha says to himself when he realises he must help the family more significantly than merely giving them bread:
To-morrow I will redeem their cornfield, and will buy them a horse, and flour to last till the harvest, and a cow for the little ones; or else while I go to seek the Lord beyond the sea, I may lose Him in myself.
Elisha is a perfect example of one who, as Tolstoy says, shows love and does good towards others. Even though he physically was not able to make it to Jerusalem, like Efim, spiritually he was there, and his sacrificial acts were recognised by God, as Efim realises when he sees how God has blessed his friend. Tolstoy establishes the central theme of the story: going on a pilgrimage will do no good if you are not living the right kind of life before God, which is what Elisha realises when he decides to help family and therefore ensure that he will not "lose" God within him.