I just asked my Pastor this week what I should pray re. my ex husband. I said I was still praying for him, but I just didn't know what I should pray for: That he seek God's will for his life? That he have wisdom and discernment to see the error of his ways? (He had an affair, left me, and after taking a break is once again seeing the ow. Along with this, add porn use/addiction and the like.)
Pastor said, "Do you want him to come back? Because if you do, then pray that he come back. And it is not wrong to also pray that he hit rock bottom and be convicted. If you were married in church before God (and we were), then your divorce is a legal matter, decided by a judge, but that is not your spiritual covenant that you made before God."
And he said that even with adultery, God's law says we are free to divorce and remarry, but we are not compelled to--we can still choose to pray for the restoration of our marriages.