in which he clarifies that a prayer recited for a friend is remembered in times of need
"Yet, when they were ill, my dress was sackcloth, I kept a fast— may what I prayed for happen to me!" Question: If the prayer is returned to the person, it would appear to not have been accepted. Why, then, should the person pray? But according to the introduction of Rabbi Yehuda the Righteous, of blessed memory, this can be clarified. If a person's friend becomes ill, Heaven forbid, the person must pray for the friend. If the prayers are answered, that is best. But if it is not, when that person encounters similar troubles, the person's compassion in praying for a friend is remembered, and the person is healed. This corresponds with the text, "Yet, when they were ill, my dress was sackcloth, I kept a fast". If you say, 'What if it is a decree that will not be annulled, how can prayer help?' the reply follows, "May what I prayed for happen to me". When I need Heaven's compassion, my prayer for a friend will be remembered, and I will be treated with compassion.
Tehila VeTiferet, Psalms 35, "When they were ill", p. 105 – 107, published by Abraham Moshe, Jerusalem 1971