this is definitely something i've experienced! in my case, i have a number of reasons - i used to take testosterone and my libido completely changed, and now have gone off it. i have sex-related trauma and triggers, most of which i have recovered from, but they still sometimes interfere. my conditions can affect libido and other areas of the experience. i'm on an antidepressant that causes low libido as a side-effect.
despite that, i still have a decently active sex life, even if not as active as it once was. and i have some ideas.
could you maybe go up until the point your libido is gone, then he finishes it off for himself? we tend to have very rigid thoughts about what sex has to look like, but it's so much more broad than that. sex can be just as fulfilling as intimacy, even if it doesn't reach a mutual climax or end with penetration. could you do longer foreplay where you get a need for intimacy and comfort fulfilled while he's getting sexual pleasure, then use your limited libido to enjoy a sex act together? could you maybe continue with your hands after you can't continue whatever other act you were performing, even if just on his chest, arms, thighs, or other sensitive areas while he masturbates?
you could also experiment with new positions or acts to try and find things that don't hurt as much - a wedge pillow is excellent if you get back or hip pain, for example, or for people who can't do penetrative sex, intercrural with a good lube might be a good option... and of course, if it's really just the libido getting in the way, you could always try discussing options with your doctor, if you haven't already done so. there could be other options to help raise your drive.
i'd be happy to help you brainstorm ideas to try if you have more details to share. and remember if something sounds like a good idea remember that you'll need to present it to him. if you try it out, keep an eye on your comfort level and express it if you want to stop. ask him to do the same, and ask how it was afterward or if he seems uncomfortable during. communication about the experience is key. i'm sure you'll be able to find something that works well for the both of you, even if it takes some experimentation ::]