I assume we're talking 3rd party here..so lets use GTAIV as an example.
Rockstar is the publisher
Rockstar North is the developer
Sony & Microsoft own the consoles
Rockstar North make the game using Rockstars money. Rockstar North uses that money to pay for staff, rent, computers, software etc. Rockstar then takes the finished game and mass produces it themselves. Rockstar will then sell that game to EB for say $25 each. $5 of that will go straight to Sony or Microsoft. The rest goes straight back to Rockstar to recoup the costs, and then make a profit. Rockstar North won't really see any of those profits, but they will likely get paid more for their next game if this one does well.
So no, Sony, Nintendo or Microsoft don't pay people to games for their system. They take a profit. Sometimes they will pay money to have a game come exclusive, or at least time exclusive. This wouldn't be more then they expect to get back from their $5 per copy profits, unless they expect it to help sell their system that they will get more money from all the other games.
Ofcourse with first party games, like say Mario or Zelda with Nintendo it's all within one company so the lines are blurred.
It's why the console makers are willing to sell the consoles at a loss at launch, because they want to make back their profits with game sales. If they are making a profit on the console sale itself then that's just a bonus.