The fact she can't lie down worries me.
Without seeing her, it's really hard to know for sure what is going on. My two main concerns are congestive heart failure (CHF) and kennel cough.
Here is a video about coughing in dogs, explaining that coughing can be a symptom of many different underlying problems – some quite trivial and some very serious.
With CHF, it tends to come on slowly over months.
One of the classic features is "orthopnea" which means that patients cannot lie down, as then they cannot breathe. These dogs often try to sleep while propped up on furniture in a sitting position. I'm a bit worried that this may be what Pecan is doing.
They stand with their elbows abducted (sticking out from the chest) to try to increase the lung capacity. They often have clear fluid dripping from their nose. This may be why Pecan is licking between coughs - she may be licking away fluid that is dripping from her nose.
Here are some links to more information about congestive heart failure (CHF):
And a great video explaining it:
CHF is something which needs prompt veterinary attention.
If this is what is going on, then Pecan 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 the chest to see how much fluid is there, and what size her heart is, if this were diagnosed.
Once stabilized, a patient with CHF would 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.
Now, the fact that this started so suddenly and that Pecan has a "terminal gag" might point towards Kennel cough. Normally, kennel cough will not prevent dogs from lying down, however. Also, she has been vaccinated for this, so even if she gets it, it should not be a severe case.
However, what you are describing could be Kennel Cough.
Let me explain...
Kennel cough (Bordetella, infectious tracheobronchitis) is a highly contagious cough that is transmitted by saliva or through an aerosol when a dog coughs.
With kennel cough, dogs have a cough that sounds like something is stuck in their throat, and after coughing a few times they have what is called a "terminal gag" which means that they sound like they are bringing up phlegm.
If you watch closely, you will often see dogs swallow after this final gag - they are in fact swallowing phlegm.
Some dogs will even cough up a puddle of clear, whitish, or slightly yellow mucoid fluid.
Kennel cough is highly contagious so dogs that have this should be kept isolated from other dogs for 2-3 weeks until it resolves.
It is possible that Pecan got this from another dog walking by the yard, or by picking up a stick that was in the mouth of another dog that had kennel cough, or you could even have brought it home on your shoes/pants if you passed a dog that had kennel cough. It is HIGHLY contagious - just as the cold and flu viruses are for humans.
The incubation period (time from when she was exposed to it, until time she starts showing symptoms) is anywhere from 3 to 10 days.
Most cases resolve without medications, but in some cases patients are put on antibiotics and/or cough suppressants.
Antibiotics are used in dogs who are at risk for a secondary pneumonia (very young or very old dogs, or those with a suppressed immune system).
Cough suppressants are used when the cough is so severe that the dog cannot sleep. There can be quite a bit of phlegm with kennel cough, and it is better that the dog DOES cough that up, rather than leave it in the lungs by suppressing the cough. However, there has to be a balance where it's possible for the dog and his human companions to sleep.
For dogs that are unable to sleep, I do sometimes advise owners of my patients that they can give cough syrup. I advise them that it is very important to read the label carefully and find a cough medicine that contains ONLY dextromethorphan (DM). This can be given to dogs.
Talk to your vet about whether this is ok for your dog!
Here is more about precautions and dose:
Watch your dog to see if she is retching or gagging at the end of her coughing episode. Since it sounds like she is, and because she is coughing up puddles of phlegm, she likely has kennel cough. Many dogs will vomit due to the intensity of the coughing.
I'll give you links to further information:
If she coughs up fluid that is green, or is blood-tinged, or she is lethargic or has difficulty breathing, then you should definitely see a veterninarian immediately!
Many dogs with Kennel Cough seem to have a sore throat and thus don't want to eat their dry food. You can soften it with warm water to make it easier to swallow.
Keep your dog isolated from other dogs for at least 2 weeks! Keep her as quiet as possible - just out for potty breaks and back in. Kennel cough usually gets worse for 2-3 days, then frequent coughing with phlegm for 2-3 days, then starts to slowly get better.
It is also helpful to walk dogs with Kennel cough on a head halter or chest halter, as a leash around the neck can pull on the trachea and start a coughing spell.
I do hope that this helps you to help your dog! If she continues to have problems lying down, it would be prudent to see an emergency veterinarian in order to be sure that this is not congestive heart failure. The fact it came on so suddenly points away from this, but the fact she cannot lie down does concern me.
I wish there were more I could do over the internet to help you to help Pecan!
If this has been helpful, please "Accept" my answer and provide feedback.
If you need more information, just click on reply and I will still be here to answer further questions!
The above is given for information only. Although I am a licensed veterinarian, I cannot legally prescribe medicines or diagnose your pet's condition without performing a physical exam. If you have concerns about your pet I would strongly advise contacting your regular veterinarian.
Best wishes to you and to your dog! Fiona