Turbinate Tissue. When you lay down.. Either on your back or side, the turbinates (tissue on the side of you your nose - inside) swells up. This is why people feel stuffy with allergies, crying, etc. Some people will notice that the feeling of stuffiness changes from side to side as they turn over in bed. If the stuffiness is severe, it could lead to nasal and then sinus congestion which may lead to a headache.
Several causes. When you lie down because of gravity more blood reaches the nasal passages causing some congestion. Plus, if you have dust mite allergy or pet dander allergy (and have a pet sleeping on the bed) the congestion gets further enhanced. Also, your immune system along with your body as a whole is toned down in you are sleep and goes into an active state when you get up.