Good mountain biking shorts are the most important piece of mountain bike clothing. Shorts or pants with a quality chamois will provide the padding that you need to spend a long time in the saddle without feeling too sore. In general, the best shorts have a high-quality chamois, but a quality chamois generally raises the price of shorts significantly.
There are many different types of mountain bike shorts available. Traditionally, the tight lycra shorts were favored due to their freedom of movement. Recently, bib shorts have also been favored for similar reasons, although the bib straps provide additional security and keep the shorts from moving around.
Now many mountain bikers choose to wear baggy shorts. Baggies feature either an integrated or a detachable chamois liner, as well as an exterior short that looks more like a normal cargo short or pair of casual shorts. However, while the exterior short may look very casual, generally it is made of durable synthetic materials that can withstand heavy use and that also wicks sweat away. Baggies often feature many external pockets for additional gear storage.
In cold or rainy weather, wearing a pair of pants is preferable. Many riders choose to wear full-length thermal tights, which often include a chamois as well. These tights can provide the warmth needed for winter conditions while keeping the pant material away from the drivetrain.