I'll start off by saying if this is an on-going problem, get yourself to a cycling specific Physio.
Long story short, I started riding a number of years ago now, and always struggled with on-going knee, calf and back pain. My step mum is a very well reknown dance physio, I'd been seeing her and her partner the whole time. It was getting worse, so I'd stop riding, I'd get better, ride again and pain again. I eventually went and saw a Sports doctor, who gave me a cortizone injection as she had no-idea what was going on after looking at an MRI of my bad knee that showed it was in perfect order. cortizone gave no results. She gave up and palmed me off. I then went and saw Trish Wisby Roth, who is a Cycling specific physio. I only had to see her once, she did a full diagnosis, put me through a series of processes that essentially went through her check list that she has developed. Half way through she said, I know what's wrong, but we'll finish the process. It turned out, I had very week Glutes, slight bias in my quads. Very tight quads and tight Tibial nerve in both legs.
Essentially, what was happening when I rode, I was getting a sore back, soreness and tenderness on the outside of my leg from the knee, a sore lower hamstring tendon and occasional knee cap soreness.
The Glutes weren't firing in my motion and my hamstrings were taking the load, so the hamstring was getting massively over loaded.
My tibial nerve was tight and was getting irritated around where it comes from behind the knee to the outside of the knee.
My quads were tight and pulling on the front of my pelvis, combined with a weak core, the lower back muscles would do all the work in keeping me upright.
The fixes;
Glute training, I had to learn how to use my glutes, strengthen them and train myself to use the glutes in my cycling motion. It was so hard at first to distinguish what to do to actually activate the muscle. Everytime I thought about activatving the glute, my hamstring would fire. I had to turn that off. Very hard.
Simple tibial nerve stretches.
Heaps of quad stretching.
Heaps of core strength work. The core creates a stable platform for the body to work. A nice and strong core, allows the correct muscles to work and do thier job as they are meant to, without other muscles taking up the slack.
The result, within a couple of months I found my riding fitness, strength and enjoyment increased infinitly! I got this done last year and in that year I've come leaps and bounds.
I am not saying this to give you reasons why your back is sore, I am saying this to advise you to get the right diagnosis and treatment. Your pain is probably something totally unrelated to what I had, but if you see someone that knows the effects cycling has on your body and specialises in it, it's invaluable! My Step mum is an exceptional physio, however, her expertise is in dance, in hindsight she can see exactly what Trish found, however, she didn't have the experience with cycling related injuries or pain to easily diagnose. Essentially, what unsuccesfuly took her a couple of years to treat, a recommended sports doctor to give up on, it took Trish one visit.
Just bite the bullet and get it looked at, everyone on here has had thier own experience with back pain etc. But no-one can tell you what the cause of yours is.