Speaking as someone with chronic pain, I do know how easy it is to get angry - at God, at your body and those around you, when they have done nothing wrong. My husband is very aware of my bad pain days, and is very good to ask me why I am mad at him. We talk freely about what I am going through. Sometimes he will massage the bad areas, and sometimes just hold me. And he will take me to the ER or the doctor if things get beyond me.
You don't say why or what the pain is, but it sounds to me like his pain is not well controlled. Has he seen a pain doctor? What about a physiotherapist? Exercise has helped me in amazing ways, although my body finds new ways to hurt!
As for you, I do think you need to pray both for and with your husband. When I have a 10/10 day, I do get angry at God. But fortunately, God always seems to touch my heart, and then I can repent and walk with God again. But certainly, there are days I just want the pain to end, any way possible. I wonder if those days are the ones your husband is more angry? There is a frustration with being a Christian, having a good family and wife, but not being able to enjoy or appreciate it.
People here talk about setting boundaries. Normally I would heartily agree. But when the pain gets bad, those boundaries aren't even remembered, let alone adequate. I think you really do need to look further for some answers to help your husband reduce his pain. Unless you have exhausted every avenue, there are amazing things being done for pain management and you need to help him get access to these things.
As for you, I think you have to cultivate a little bit of detachment and compassion. You may hurt for a few minutes from the stinging anger your husband gave you. But imagine having to live 24/7 in a body that hurts all the time! It's tough being married to someone who is physically hurting, but God is going to be there, and he chose you for this task, which he knew would happen.
Praying you can get some more help for your husband, so that your marriage can be restored, and you can make it through all these bad times, in sickness, as the wedding vows say.