That scratchy, irritating feeling at the back of your throat while you are trying to sleep can be maddenly annoying. You have the tendency to cough more when lying down because of aspiration of sinus drainage into the throat. When you are sitting up, sinus drainage is more likely to run down the back of your throat and be swallowed. As well when you are lying down mucus could be resting on your vocal chords and you tend to breath it, therefore stimulating your cough reflex. That being said, coughs from a lung infection such as bronchitis
can start out suddenly and then linger on. If you are bringing up green or brown mucus, a night or two of poor sleep may be necessary for your body to get rid of mucus. Green or brown mucus often means an infection in the respiratory tract still remains. If the mucus isn't green or brown, you can put a humidifier in the room to help thin out the mucus as well as drinking a lot of liquids. However, if your cough lasts more than three weeks, it is considered a chronic cough. Please schedule a visit with a primary care physician
. Good luck.