She might have post-nasal drip and of course, laying down only makes that worse. Additionally, IF she only has it when laying down, could be dust mites.. they like to burrow into mattresses and pillows and it's their , how shall I say this.. "left overs" that are what makes a person sick. Often kids are allergic to them. Dust mites are common in the bay area as they like that damp air...... it's a good breeding ground for them..hence, makes it hard to get rid of them. You can buy plastic pillow encasing and the same for a mattress that is suppose to help somewhat. I have heard that to know what or IF a child is allergic to something environmentally BEFORE about 6 or 7 is too young. why? because they haven't had enough time yet to experience a full year of seasons . It's only when they are older that doctors can begin to rule out pollen and hayfever.... for now, maybe it's a food allergy and that is what is causing the phelgm and in turn, the possible post nasal drip. I would take her to a children's ENT or your regular doctor (although they don't always know too much about allergies)
if it's that..
best of luck