Most of us here have bought many firearms online and generally have had few problems, but you need to know who you're dealing with.
If the seller is a legitimate dealer or an online seller with lots of public feedback, you may be pretty safe, but if it's a private seller, I make sure I know who it is, where he lives, how to contact him, etc. I make sure his name and street address and phone number all reconcile, and I'll google his name to try and find any background I can. Speaking to him on the phone often helps ease my mind.
Most online sellers want paid by USPS money orders or credit card, both of which can help protect you. If you pay by CC and don't get the item, call the credit card company and stop the payment. They will help. If you pay by MO and don't get the item, you can get proof that the seller cashed the MO (but it may cost a few bucks and take a while to get the proof). You can also ask the post office for your options to get satisfaction. Because fraud involving the post office is a federal offense, most sellers will probably try to avoid any legal entanglements.
Once you strike a deal with an online seller and pay (or arrange payment), you'll need to find a licensed gun dealer near you to transfer the rifle (you can NOT have the rifle shipped to you...it MUST be shipped to a licensed dealer in your state). If you're buying from a private seller, ask your dealer if he's ok with transferring from a private seller. Some dealers are hesitant to do so.
Once you select a dealer, you have to ask him to send the seller a copy of his FFL. Once the seller has that, he will ship the rifle to the dealer. When the rifle arrives at the dealer, he'll call you to come get it. You show up, fill out the form 4473, pass the background check, pay the dealer his fee (figure anywhere from $25-40 in most areas)...and obey whatever other state laws you live under.
To start with, however, make sure you know what you're buying. Ask for plenty of photos. Ask specific questions about condition. Find out what's included (mags? sling? case?).
Make sure you're comfortable with what you're getting.
Make sure you're comfortable with what you're paying.
Make sure you're comfortable with who you're buying from.
Oh, and make sure you know your state laws.
Nothing to it!