How do I choose a good mountainbike
How do I choose a good mountain bike?


Summary
Everything on a bicycle is important.  

The most important part of a bicycle is the frame.
The best bike for the money will have:


The best quality of frame construction you can afford. Frame quality includes the quality of materials and craftsmanship. Generally, the quality of the components increases as the quality of the frame increases (there are exceptions to this, it can't be taken for granted)
The correct geometry to fit you correctly and support your riding style. There are a variety of geometries to choose from no matter what your price range.  


Selecting the correct geometry to support your riding style is a matter of situation (where and how you ride) and opinion that can only be developed by saddle time on a variety of bikes on different terrains. That being said, it is possible to generally describe riding characteristic trade-offs for different frame geometries. Understanding the characteristics can help riders make informed decisions.

At a high level the best frame geometry is finding the right balance between nimble handling and stability for your specific needs / preference.  

Details
Here is a picture of some of the key factors in mountain bike frame geometry.
  

I have taken the lettered list from Jamie Darlow and have elaborated on the descriptions integrating comments from his article.
A – Head angle - the angle between the ground and the head tube. Generally the more vertical the head angel the more nimble and less stable the ride.
B – Seat angle - angle of the seat tube relative to the ground. This determines where the seat is in relation to the pedals which effects pedaling efficiency and weight distribution between the wheels.
C – Bottom bracket height - distance from the ground to the center of the bottom bracket. Effects your center of gravity and pedal clearance.
D – Chainstay length - distance from the center of the bottom bracket to the center of the rear wheel. Effects weight distribution between the wheels and wheelbase.
E – Front Center- distance between the center of the front axle to the middle of the bottom bracket. This number is influenced by
F – Wheelbase - distance between the wheels. As a general rule longer wheelbase is more stable and less nimble. Shorter wheelbase is more nimble and less stable.
G – Down tube - distance from the middle of the bottom bracket to the center of the bottom of the head tube
H – Top tube - distance between the top center of the head tube and the seatpost
I – Reach - distance between the top center of the head tube and the verticle line that runs through the center of the bottom bracket. This number helps with sizing a bike correctly.    

Frame part diagram


Better bike makers will publish frame geometry specifications for their bikes.  

Frame construction is a complicated topic full of technical details and passionate opinions. The information provided should provide a beginning point for more research.

An example of an area for further research is the effect different frame materials - aluminum/steel/carbon/titanium have on riding characteristics.