A quarterback's rating is calculated using a formula that takes into account their completion percentage, yards per attempt, touchdown percentage, and interception percentage. These four statistics are plugged into the formula to determine the quarterback's rating.