Is praying for unbelievers who have passed away a form of ministry to the grieving?

Is praying for unbelievers who have passed away a form of ministry to the grieving?