I don't know the exact stuff either, but I do know they have different rates for times of day, days of the week and even the types of commercial breaks. Like, in a 9 inning they game, they know 100% there will be X amount of breaks during the pregame, and between each half inning. Those will all have varying rates depending on the time of the night they happen. Like a commerical in the 1st inning might cost more or less, because its's at 7:15 eastern, vs a commerical in the 7th that might be at 9:15 eastern. The rolling TV viewership numbers is what dictates the rates. Since those commerical blocks are guarantted to happen and they have a very solid idea of the time they will occur, those rates will be pretty much set in stone.
The varying rates will the extra breaks for possible injuries, in game delays, pitching changes, extra innings... those will have variable rates because they won't know exactly when they happen, nor exactly how many of them there will be. They'll have a pretty good idea with averages from previous years... so they will generally have a bunch of companies that sign up for the variable spots, and then they pay X amount for X # of commercials. When they run over their alotted number, they either stop running that companies ads, or get them to re-up.