Magnesium, with a Z = 12, is an extremely common element in the crust of the earth, but it is never found in nature in the elemental state. It is the second member, after beryllium, in the alkaline earth series of elements. It is above calcium in that same group, and has significant biological roles.
As is the general trend for elements on the left hand of periodic table, magnesium is less reactive than calcium, just as beryllium is less reactive than magnesium. This is due to the fact that elements in the first and second columns have their electrons more tightly bound the higher in the column they appear because of less shielding from other electron shells.