Poor little thing. I don't know if my suggestion will be any good and I'm sure you'll get lots, but has she got a night light if she thinks there's something bad in the dark? My daughter had one or two bad dreams that made her so scared she came to our room when she was little (about 4 or 5 actually, coincidentally) and I calmly took her back to bed, snuggled her in and told her it was just a bad dream. She was OK. I think if you flap it can make them worse.
Funnily enough, my daughter and I have recently discussed the bad dreams she had when she was little now that she's older (she can still remember them so they really did spook her) and she thinks we did the right thing with her. However, every child is different - as is every parent - and I'd hate to think your friend's daughter was upset more by something I'd suggested!
Was it a dream or was there something else? Is there a tree outside that 'taps' her window, or is the wallpaper offending her? We redecorated my daughter's room once because the nice, cartoon wallpaper of the daytime turned into witch's faces at night (I actually had to spend some time in that room in the dark once to see it, but once it had appeared, it was always there, and just as she described). Has the cat jumped on your friend's little girl for a cuddle while she was asleep, then when she reacted so suddenly, disappeared from the room?
I hope someone else can be more useful than I've been and I hope your friend manages to get to the bottom of the problem because there can't be many things worse than seeing your daughter's distress in that situation.