According to current USDA estimates, 80 cents of every food dollar spent in the United States goes to off farm costs, including marketing, processing, wholesaling, and distribution. This leaves a mere 20 cents of every food dollar to return to the farmer's pocket.
The Economic Research Service (ERS) calculates the farm-to-retail price spread; the difference between the price paid by consumers for a food item at the store and the amount of money received by farmers for the commodities used to produce that same food item. To do this, they use two data sets, the marketing bill and the at-home foods by commodity group.
For example, this year at Safeway grocery stores one gallon of fat-free milk retailed for $4.09. The farmer's share, the percentage of the price of food that is explained by what farmers earn for the agricultural commodities needed to produce the food items, of this was 28.6 percent, or $1.17.
For a more in-depth look at how these prices are determined, this link is a great resource. This site breaks down how the ERS calculates the farm to consumer values for all classes of dairy products and gives farmers the opportunity to determine their share of consumer's expenditures on food.