This question is just painfully dumb to me. It depends on the situation whether she is a girlfriend or a friend, whether you "know" what is wrong and are just trying to talk about it or whether you are clueless, if the girl is serious or if she cries over everything, etc etc. It's just basic human interaction. Forget the fact it's a girl, just think about it from a human perspective.
It all depends on the girl. My girlfriend just likes a hug and for me to listen, and if she being ridiculous you need to make her see that. For someone with no social skills just sit awkwardly next to her and consider putting an arm around her until eventually she stops.
I support those that say to sit by her side and just stay there, if you guys are close enough, then give her a tight hug too. If she is ready to talk then just listen, only listen. Then maybe once she has let it all out, make her laugh, or comfort her, by showing that you can relate with her. Then later when she is feeling better, if she was being unreasonable show that to her.