OK, so you got a rock. How do you determine how old it is?
One thing that should be made clear from the beginning: The age of a rock is really just a measure of how long it has been since the rock cooled to become a rock, not how long the material has been around. If you take any rock, melt it, and let it cool back to a rock, it will be a new rock with its age clock reset to zero years old. You should keep this in mind when we are talking about determining the age of rocks.
A more relevant example: Let us say that a rock is sitting on the surface of the Moon. A billion years after that rock was formed, the rock is covered and remelted by a lava flow. Two billion years after the lava flow that rock is uncovered by an impact and thrown to the surface. The rock is then picked up by an astronaut, brought back to the Earth, and dated. The age determined for that rock will be two billion years old, NOT three billion years old.
Of course things can get more complicated. The impact that uncovered the rock may have melted part of the rock, reseting the age clock for a portion of the rock. Of course things can get EVEN more complicated. Most rocks returned by the Apollo missions are impact breccias. These are are a mixture of different rock samples that have been "welded" together by the impact process. Each of the different rock types in the breccia may have different ages, and the "welding" process itself may have even reset the age of some part of the rock. Untangling this whole mess is what makes the science of determining rock ages fun.
In general the ages derived from samples of basalt are more consistent that the ages derived from impact breccias. The diagram below shows the ages for the six Apollo sites are determined from thier samples. The samples from Apollo 11 and 12 are mostly basalts, so, as you can see, are ages of those sites is pretty well determined (red). On the other hand, the samples from Apollo 14 are pretty much all impact breccias. The age of the Apollo 14 site (blue) is much less constrained that that of Apollo 11 and 12.
Geologist determine the age of rock using a technique called radioactive dating. This technique relies on the fact that some elements in the rocks spontaneously change into other elements at a well defined rate. This spontaneous change is called radioactive decay. Radioactive decay occurs because some elements are more stable than others, and if nature gives the unstable elements a path to become more stable, they will take it.
While there are many different elements that geologists use to determine the ages of rocks, One of the most common elemets used to determine the age of lunar samples is Rubidium (Rb).
Rubidium (Rb) is the 16th most abundant element in the earth's crust, and is present in many different minerals. Most of the Rubidium in rocks (72.17%) is composed of 37 protons and 48 neutrons. This is called Rubidium-85. It is nice and stable. However, a fraction of the Rubidium in rocks (27.83%) is composed of 37 protons and 50 neutrons. This is called Rubidium-87. Rubidium-87 is not stable and if given the chance, it would like to change to a stable state. This change to a stable state is what we call radioactive decay. Rubidium-87 changes to a stable state by having one of its neutrons turn into a proton by kicking out an electron (and an antineutrino) and turning into Strontium-87. This process is called beta-decay and can be written down like this:
Now the key to this whole process, and why we can use it to determine the age of rocks, is that the radioactive decay of Rubidium-87 happens at a very well defined rate. This well defined rate is called the half-life. The radioactive decay of a single Rubidium-87 atom will happen at a completely random time (radioactive decay is one of the few truly random phenomena in nature). That single Rubidium-87 atom has a 50% chance of decaying within a time-span called its half-life. Another way to think about this is to say, that for a very large bunch of Rubidium-87 atoms, 50% will decay within one half-life.
The half-life of Rubidium-87 is 47.5 billion years.
A simple example (see the diagram below): Let us say that you start with 1000 Rubidium-87 atoms. 47.5 billion years later about one half of them will have decayed into Strontium-87. After one half life you will have about 500 Rubidium-87 atoms and 500 Strontium-87 atoms. In another 47.5 billion years you will have about 250 Rubidium-87 and 750 Strontium-87, and so on.
As you can see, after a handful of half-lifes, very little of the original radioactive material remains. It is a finite resource. This means that is some pratical concern when it comes to determining the ages of Moon rocks. Since every measurement has some limit to how small an amount one can measure, if you want to measure the amount of radioacitve material in sample, you can not wait for 1000s of half lifes.
What this really means is that half-life of the element you are trying to measure sould be of the same order of magnitude as the age of the sample. For example, an element with a half-life of 1000 years is not a good choice for determining the age of Moon rocks, since it will have gone through about 3,000,000 half-lifes! At the other end of the scale, an element with a half-life of 47.5 billion years, is not a good choice for determining the age of a young lave flow on the Earth, as very little of the radioactive material would have decayed.
Determining the age of rocks would seem to to be a simple matter of measuring the amounts of Rubidium-87 and Strontium-87, and since you know the half-life of Rubidium-87 you can determine the age of the rock. Well, nature is never really that nice. The main problem is is that we cannot assume that the rock has no Strontium-87 to begin with.
To get around this problem, a much more robust method of radioactive age dating has been developed called Isochron Dating. In this process you determine the abundance of Rubidium-87 and Strontium-87 in many different minerals in the same one rock sample. You also determine the abundance of a stable element for comparison. In our example, the comparison element we will use is Strontium-86, a stable version of Strontium that is not the result of a radioactive decay. In practice it is often much easier to measure the ratio of two elements, rather than one element all alone. For rock dating we often measure the ratio of Rubidium-87/Strontium-86 and the ratio of Strontium-87/Strontium-86. The actual determination of the Rubidium and Strontium abundance in a sample in a very non-trivial tasks, that takes a lot of sophisticated equipment. It is really an art.