I would recommend that you consult with your primary care doctor
about this, especially if the pain is persistent or severe.
You are definitely right that the most common cause of pain in the lower back on one side does have something to do with the muscle. What typically happens is that the muscles that run up and down along the side of the spine become strained or overworked, typically from things like bad posture (think: sitting at a computer screen all day long) or heavy lifting. When this happens they can become acutely inflamed and even, sometimes, go into spasm. This produces a sometimes severe pain located along the involved side of the lower back.
The other condition that can cause pain on one side of the back like this is a slipped disk or a pinched nerve. Unlike muscle strain
, however, either a slipped disk or a pinched nerve will usually produce pain that runs down the leg, not just limited right to the lower back.
Either way, the first place to stop is your primary care doctor's office. They can evaluate your symptoms and help you decide what are the best treatments for your pain.