I have a problem that sounds very similar to yours. After my lung collapsed, I got a chest tube on the right side. Now like an inch lower where the tube was inserted, I get this random muscle pain. Feels like it is between my ribs...
Either from benching or laying on my right side, this pain suddenly appears and then disappears later. A doctor I saw said it was a muscle. He said it wasn't my lung.
He didn't tell me a remedy to deal with this pain, just to maybe stop working out, which I said definately not!
I will probably see a doctor in the future to figure out a solution, as this pain is more of an annoying inconvenience, than something persistent. It is totally random and doesn't happen after every workout.