Sometimes I get pains in my lungs and have difficulty breathing in bed, but am fine when up, what could it be?

Should be evaluated. It is necessary for such symptoms to be evaluated in clinic; a full history and a physical exam and any testing as needed should provide an answer in your specific case. In general, some of the most important reasons for shortness of breath while lying down at night include congestive heart failure and obstructive sleep apnea.
Pericarditis. Pericarditis causes pain with deep breath or cough when lying down that's relieved by sitting up. If that is your symptom, see your doctor today.