Well, I wouldn't say "congratulations", that's for sure. I would probably say something along the lines of "I hope things go in whatever way is best for you". If it was a good friend I would probably let her know that I would do my best to be supportive in whatever she decided, or that if she wanted to talk about any part of it, I would listen. I probably wouldn't ask questions right off the bat, about whether she would consider an abortion, etc. I'd probably let her roll all those ideas around in her head and when and if she was ready to talk about it, I would be there to listen.
I was never in this situation but I did have a situation where I encountered an old neighbor-friend who told me that she was pregnant. She was 23 or 24 at the time, and I knew she had been in college for dentistry. I remember being surprised and didn't know whether congratulations were in order b/c she said it in such a matter-of-fact way, so I didn't really congratulate her right away, but then it seemed like she was really happy and excited about it. Oops. So basically, I just tried to feel out the situation and then I took it from there. I congratulated her before I left but at first, I really didn't think it was a planned pregnancy and wasn't sure what the "baby daddy" situation was either, so I felt like I was in an awkward situation.