Radio ratings are based on the "average quarter hour." In the average 15 minutes a percentage (the share) of people in a certain demographic who had the radio on were listening to WQQQ.
To use a real example, in the average quarter hour (from 6a-12a, M-Su) in June in Indianapolis, 9.0% of radio users 12+ were tuned to WYXB-FM. That number is very vague. Its possible that 2% of listening in Indianapolis happened was to WYXB-FM in mornings 6a-10a, 15% of radio users were tuned to in the mid-day and afternoon dayparts, and 4% at night. We don't know without access to "the book," which offers more detailed breakouts.
As far as gathering the data, there are two methods currently employed by Arbitron:
In the diary, you'd write down
"99.7 Now" and an elapsed time in a book that looked a little bit like a day planner. What actually happened for most diary-keepers is that they would sit down before bed and try to remember what they had listened to, and would make a guess. Sometimes you'd see diaries where people claimed they listened to one station all the time for ten straight hours.
The PPM, or Portable People Meter, is a device that contains a microphone and hears what you hear. If you listen to Kiss FM for 7 minutes, then they get credit for exactly 7 minutes of listening. The Meter is generally considered to be superior to the diary even though someone who works at a dentist is likely to register several hours of daily listening to whatever plays in their office.
I write in summary only, there are some real ratings experts around the forum who could write several pages more.