There are two ways to pay when riding metro: FareCards, and SmarTrip cards. FareCards are paper cards with a magnetic strip which can be purchased at any station. They work well enough, but the many benefits of the SmarTrip card make it a superior option.
The SmarTrip card gives a $0.25 discount on every Metro fare, saving you money. It also also is scanned using a proximity reader, allowing you to can your card and be on your way with the wave of the hand, saving your time (in fact, you can continue on your way as soon as the gate registers your card; you don't even have to wait for it to close behind the previous rider). As an added bonus, it is accepted by many other transportation options in the DC Metro area, including DASH, Ride On, Fairfax Connector, ART, CUE, Loudon County Transit, Omniride, TheBus, and the DC Circulator.
There are two downsides to the SmarTrip card: it costs $5.00 (but it can quickly pay for itself), and it can be harder to find. If you are taking a short trip to DC, the regular FareCard may make sense, but for anybody who will be here for a while, a SmarTrip card is the way to go. You can purchase online, here, or Metro sales offices and commuter stores, local CVS, Safeway, and Giant stores, and all Metro stations with parking facilities.