Hi there,
During this time in your pregnancy (3rd trimester) sex can become physically challenging, difficult, and extremely uncomfortable for a lot of women. Remember that sex is optional, not mandatory. Every woman is a bit different in this instance; some women can have sex up until their last week and some women can't (or choose not to).
If your pregnancy is considered low-risk (no health complications) and your doctor has no concerns, you should be okay. You might consider using a water-based lube and experimenting with different positions during sex to find one that is more comfortable for you (of course, not on your back). If nothing seems to ease the pain, then don't continue having sex.
What it comes down to, is how you feel about it. Listen to what your body is trying to tell you, speak with your OB/GYN about this, and be honest with your husband.
Hang in there, you're almost to the finish line! :)