Thanks for the further information about Gracie.
What you are describing is called "orthopnea" which literally translates to straight breathing. This is something that happens when there is fluid in the lungs (pulmonary edema). If the patient is upright, the fluid sinks to the bottom and allows for easier breathing. But if the dog lies down, they quickly get short of breath.
Most commonly, orthopnea occurs with congestive heart failure. In an older cocker spaniel, this could be caused by a few different things, but mitral valve disease would be the most common. Basically, when the heart beats, not all of the blood inside it is pushed forward as the mitral valve often becomes "leaky" in older small breed dogs. So, now you have more blood coming in, PLUS that leaked blood that didn't go out, so the pressure builds up inside the heart. This then backs up so there is increased pressure in the blood vessels in the lungs. Because of the increased pressure, fluid gets squeezed out of the blood vessels and into the lungs. With water in the lungs, it is very difficult to get oxygen across the lungs into the blood stream.
Here are some links to more information about congestive heart failure (CHF):
This is something for which Gracie needs prompt veterinary attention. She may need injections of a diuretic (such as Lasix/furosemide) to quickly move the fluid out of her lungs so she can breathe more easily. The vet would likely get x-rays of her chest to see how much fluid is there, and what size her heart is.
Once she is stablilized, she will likely go home with Lasix in pill form so that the fluid doesn't build up again, as well as something called an "ace inhibitor" to help the heart function more effectively.
It sounds as though Gracie is having a rough time right now, and it must be distressing to her to feel so short of breath. Please get her to a veterinarian as soon as possible!
If this has been helpful, please hit the green "Accept" button. I will still be here to provide more information if you need it!