I have a pacemaker...But I am having trouble breathing when I lay down. What could it be?

CHF. Shortness of breath lying down strongly suggests a failing left ventricle, pacemaker or no. Often people with pacemakers have lost both the av node and some heart muscle to disease. We also need to consider something mechanically impinging on the pulmonary venous return to the heart. Schedule a physician's appointment as soon as you can, and get several pillows.
Possible CHF. It may mean that you have congestive heart failure i.e. Extrafluid build u p in your body with leg swelling. When you sleep flat the fluid creeps up to the lungs making you short of breath. If you have edema you will need to control salt and water and take your water pills. Other options are lung disease, like asthma, emphysema, or pneumonia. It is imperative to check with doctor before emergency.
Fluid overload. Sounds like it could be fluid overload or a problem with the heart muscle. It may be reasonable to get a clinical; exam, chest xray and an echocardiogram. Kidney and liver function need to be assessed as well.