Depends what you’ve done as to the best medicine.
I have a herniated disc ad L5/S1 (basically lower back) and although when it went the first time I had to have interesting x-ray guided injections, if I tweak it now I use diclofenac and co-codamol.
When mine ‘goes’ I have no option but to lie down as I just can’t move otherwise. But it is normally only for an hour or so then I get downstairs to take some tablets. After that usually walk round the house trying to keep my back straight and stretching occasionally before it frees up some hours later.
After a few days on the diclofenac it is usually ok again. I try not to take co-codamol for more than a day or so as it is nasty.
However different people need different remedies so if yours still hurts or gives you pain get down to the docs.