For fossils that are older than can be dated with carbon-dating (i.e., older than around 40,000) we have to use a different, but related technique. As I said in my last post, there are radioactive elements with half-lives of the appropriate length to be able to date specimens that are on the order of 10s to 100s of millions of years old, but these elements aren't normally incorporated into the bodies of living animals, or if they are, it's in too small of quantities for radiometric dating. So we must find something else to date. In most cases, we date igneous rocks - that is rocks that solidified from molten rock (lava and magma). It's this solidification that provides the key to this technique.
Take potassium-argon dating. Potassium is a relatively common element in rocks, and when rocks solidify, i.e., crystalize from molten forms, the potassium becomes locked up in the crystalline structure of the minerals in the rock, and no more potassium can be added or lost from the mineral. This is equivalent to the organism dying in carbon-dating - no more carbon gets added to the organism. Some portion of the potassium is radioactive (i.e., a radioactive isotope) and begins to decay. It's decay products are also trapped in the crystal, so if we can measure the ratio of parent to daughter - the radioactive potassium to its decay products (in this case argon) we can get a date for how long ago the rock crystallized.
But as I said, this only works on igneous rocks, not on the actual fossils. These sorts of rocks include basalts - which are hardened lava flows - or ash deposits from volcanic eruptions. We don't normally find fossils in either of theses types of rocks, but these deposits can be interbedded, i.e., in between, the layers of sedimentary rocks that we normally find fossils in. So to use igneous rocks (specifically the radioactive elements in those rocks) to date fossils we have to use a concept called relative dating. This is just like the name implies - dating a sedimentary layer (and the fossils in it) relative to some igneous layer. (We say we are dating the igneous layer absolutely, i.e., we are putting an actual date with a number on it.)
There are a number of rules for using relative dating, sometimes called Steno's Laws after the 17th century bishop and scientist who laid them out (all puns intended). The first is the easiest and most common-sensical - the Law of Superposition. This says simply that older layers are underneath newer layers. As you fill up a bowl with sand (or a geologic basin with sediment) the stuff that flows in first, and is at the bottom, came before the stuff on top of it. Like I said, common-sensical, but also very powerful. So if there is a sedimentary layer sandwiched between two igneous layers, and I can absolutely date the two igneous layers, it gives me a range for the intermediary sedimentary layer - it is younger than the underlying igneous rock and older than the overlying igneous rock.
The other laws are nearly as simple, and not really worth getting into here. The key is that these laws, in combination with absolute dating can give us relatively narrow ranges for dating fossils found in sedimentary rocks. And there are other tools as well, like magnetostratigraphy and biostratigraphy (perhaps topics for another time) that can help further narrow ranges down. So although most fossils can't be dated themselves, we can make excellent estimations of their ages.