The most likely reason is that you might have a sinus infection.
This can arise as a complication of the viral infections we know as the common cold or flu, which may also account for your cough.
With sinus infections, the openings to the bony cavities we call sinuses become blocked, usually partially, but sometimes, completely. When you cough, pressure within the sinuses build up leading to pain. The blockage can be dependent on posture which may be the reason that pain is not as bad when you are lying down.
Of course, there can be other reasons for your symptoms and if they are not improving, or linger, please seek further advice from your doctor.
Do you have questions? Please feel free to ask.
Stay up to date with the latest pollen information by finding your local pollen forecast from over 30,000 locations across the UK.