You can use the average method to calculate the average value for a particular column. For example:
Person.average(:age)
Will return the average age of all people in the Person model.
An example of customizing the query:
Person.average(:age, :conditions => ['age >= ?', 55])
This would return the average age of people who are 55 or older.