Whether for a hard tail or dualie, shocks are an important consideration for your mountain bike. Dual suspension mountain bikes in particular have enjoyed huge advancements over the years, most notably due to shock performance upgrades and new technologies. As trail and XC riders, you're familiar with the struggle of your rear damper bobbing up and down as you make a long climb, and that excess motion is highly inefficient. Current frame designs and rear shocks mean that dual suspension bikes are totally do-able now, so the rear shock cannot be overlooked as just another bike component. Popular shock manufacturers offer air and coil-over versions of their shocks in order to fit virtually any frame. You'll have shock options such as: a lock-out mechanism; high and low speed compression settings which you can adjust, sometimes on the fly; high and low speed rebound, great for setting control levels for your rides; and efficiency settings for how you pedal. There is also the issue of spring rates, which applies to either air or coil. Basically, you'll find a plentitude of rear shocks for every mountain bike and every riding style. So how do you choose a mountain bike shock? There are two primary types of rear shocks: coil-over and air shocks.
An air shock is built with an internal chamber in which compressed air provides the shock resistance you desire. A coil shock works by compression of a steel or titanium spring - hence the name spring-loaded shock - which is found outside the shock body. Both these types of suspension have been in use since before mountain bikes came into vogue, and both are trustworthy shock options. You may recall that BMX bikes were built in the 1970's with shocks, in which case both the front and rear shock (if there was one) was a spring variety. Between air and spring based shocks, the biggest notable difference is the weight. Generally speaking, coil-over shocks (even if built with a titanium spring) will be heavier than air-sprung shocks. Look at XC race bikes - note that you'll hardly ever see one with a coil shock, due to the weight disadvantage. When measuring a shock's characteristics, eye-to-eye is defined as the distance between the two eyelets at either end of the shock, which in turn are the bolt points to the frame. The stroke of a rear damper is a measurement of the length of the shock's ability to compress. The stroke number should be specified as to be independent of whatever frame it would be used on, and is equivalent in rough terms to travel measurement of a fork. Before buying a shock, be sure to do some online research and to read bicyclist product reviews. Through reading, you will uncover specifics about a particular shock model, gather user impressions, and hone in on which shock is right for your application.
Still have questions? Online mountain bike forums are a great resource to get advice from knowledgeable cyclists who have installed and ridden all sorts of shocks.