Severe back pain located on left side of spine around kidney area

Patient: My back has been hurting for almost 3 months, and is getting worse. I had went to the E.R. after it hurting for a month or so and they suggested a pulled muscle. It is getting worse. It is located on my spine, starting right around where the rib cage stops, and continues down about 4 inches. The pain is more direct on the spine, but flares outwards as well. It also sends sharp pains down my spine. I can’t sleep on my back because the pain is so bad. If you have any advice I would greatly appreciate it. Thank you.