. . . and now, one for the guys . . .
Discuss it with her as soon as possible.
Do not blame her. You had as much responsibility as she did.
Offer to pay for the doctor visit and morning-after pill if she wants to go that route. If feasible, offer to go with her. The same for abortion if it takes her longer than 120 hours* to make a decision. However, make sure not to suggest either option until she's had a chance to say what she thinks. It looks bad if you seem to be pressuring her.
She may not be pregnant, of course, but if she is, you're a part of it too.
If she's carrying to term—even if she's then putting the child up for adoption—tell her you'll help out in any way you can that she wants. You then have to do this, of course. That can include money, emotional support, helping her through whatever flak she may get for getting knocked up out of wedlock, accompanying her to doctor visits, looking after her health, and other things.
If she's raising the baby, decide what level of participation you're comfortable with. At the very least, offer reasonable (or generous) child support. If her idea of reasonable is more than yours but less than the court's, you'll regret not doing this.
In this day and age you're no longer required to offer to marry her, but you can. Bear in mind that she's unlikely to think the offer is motivated entirely by love alone. However, that should certainly be the major factor. In other words, don't propose unless you were at least open to the idea before this whole mess.
If you're not living together, now may be the time—with the same caveats as for marriage. In any case, you should be willing to be a full participant in parenting, or at least as much so as you can tolerate.
She may want more than you're initially willing to give. Discuss this rationally—no "you're ruining my life, bitch!" Be prepared to compromise. Do not suggest abortion.
Be prepared, too, for her to go to the other extreme: she may now want you out of her life entirely. This will be painful, but it's as caddish to force your presence on someone who doesn't want it as it is to withdraw from someone who needs you.
There is also the matter of STIs. Transmission is more likely than pregnancy on a per-partner basis, although fertile women outnumber infected women. Here again, it's important not to blame—she probably did not set out to infect you, and you're as capable of taking precautions as she is. She may, in fact, be unaware she's carrying anything, so try to break the news as gently as possible.
If there's no pregnancy or disease, of course, the whole thing is moot.
*This originally said "72 hours," which was the window at one time but no longer is.
Don't just downvote if you disagree with me, write up your own thoughts on the subject also.
anthropod has reminded me that there's a relatively low likelihood of pregnancy from a single act of intercourse. Even a woman who has sex every day for a year has a better than one in nine chance of not getting pregnant that year.