I've had mid to upper back pain for 2months now that gets worse when lying down and causes some chest pain. What could it be?

Musculoskletal pain? See your doctor to get examined and get some test. I hope this helps. If you want to discuss my answer to your question or if you have more questions contact with me on my Virtual Practice at : www.healthtap.com/dryetimyan.
Difficult to say. Back pain is one of those things that can be caused by almost anything. Chest pain could be from angina, pulmonary embolism, aortic aneurysm, costochondritis, breast cancer, or just muscle pain. Best to have a doctor take a look at you.