|MadSci Network: Astronomy|
Apologies for taking so long in answering this.
In order to understand how the age of the Sun is measured you must first understand how the Sun works. Up until the mid-1800's it was thought the Sun was made of Coal. At the time it was the only substance known that could provide a continual source of heat and light. The problem was that the amount of coal needed to provide heat and light for the several thousands of years Man had existed was vastly greater than the known mass of the Sun. With the discovery of radioactivity by Marie Curie and then a working model of atoms and radioactivity by other physicsts, geologists where able to estimate the age of the Earth at around 4.5 Billion Years. Assuming the Sun had existed for as long it was patently wrong to think of the Sun as being made of Coal or some other substance that burned using chemical energy. You would simply need a vast amount of whatever it was. By then, advances in Spectroscopy (the science of determining what something is by the light given off) had allowed scientists to realise the Sun was mostly made of Hydrogen and Helium. The problem was then, how could the two lightest gases, one of which is inert, continually produce energy for over 4.5 Billion Years, a conundrum indeed.
In the mid 1920's advances in Atomic physics and other fields had allowed physicists to postulate that colliding hydrogen atoms would stick together and fuse into Helium giving off heat and light, this is nuclear fusion. Putting two and two together it was realised the Sun was powered by nuclear fusion. Knowing the mass of the Sun and the amount of energy given off it was possible to guestimate how old the Sun was. In a separate developement, Thomas Arthur Eddington treated the Sun as a problem in Gas Dynamics. This model came up with some equations that related the total lifetime of the Sun (any Star) to its mass. Over the years, as more has been discovered, these early ideas have been improved and revised, but are still basically correct.
So using the models found by Eddington it was found that the Sun would last for about 10 Billion Years and using nuclear fusion as a power source it was found that the Sun had been burning for around 5 Billion years.
As with all things in Science no one person done all the work to work this problem out. It relied on many people solving many problems, some one putting the clues together and more people providing better and more accurate data as time goes on. We know have a fairly good understanding of how the Sun works, are happy that the ages calculated are about right, but there are still a few major questions unanswered.
I would like to suggest a reading list about this but most books that cover this question are at least University level. Doing a quick Web Search on "Stellar Evolution" returned lots of hits but they are all technical. I would suggest mailing me if you have any questions about this answer.
Try the links in the MadSci Library for more information on Astronomy.