Games are sponsored by game portals, whether big ones such as Kongregate or MiniClip to name but two, or smaller game sites of which there are hundreds if not thousands.
Developers will create a game, then put it up for sale on sites such as Flash Game License or contact sponsors directly, where they have been known to sell for tens of thousands of dollars, or sometimes just ten dollars, or not sell at all.
These games are then distributed across the internet, Flash still being the undisputed leader in creating games that can be distributed, and these games are then used to drive traffic back to the sponsor's site, where they make their money from on-page advertising.
Flash games are a very viral marketing method. A poor game can be distributed to dozens of sites, a good one to thousands, potentially resulting in large amounts of extra traffic and maybe sales. You may get thousands of extra visitors to your site, although traffic on this scale somewhat unlikely and many of these are unlikely to be interested in your product or service, unless it is related to gaming. It will increase your brand awareness whatever.
Sponsoring Flash games is not limited to games sites though.
Advergames are games, usually commissioned rather than sponsored, that promote a traditional business. Mr. Rooter, for example, a worldwide plumbing and drain cleaning franchise, has had plumbing related advergames created to promote their brand.
These types of games will often have gameplay related to their product or service. The Mr. Rooter games are plumbing games; a car oil company could have a driving game, a toothpaste manufacturer could have a game where you need to clean teeth and keep plaque back.
As well as advertising existing products, games have been made to promote upcoming films, where the game is related to the film.
Prices for advergames can vary tremendously, as with normal sponsorship. A simple, off-the-shelf existing game reskinned and repackaged with supplied artwork is naturally going to be much less expensive than a completely new game with new artwork.
The amount of branding integrated into a game will also affect the price. A simple log is the easiest option, but custom designing a racing game where all the cars are models produced by the company, with appropriate performance and customisation options, will obviously cost considerably more.
No matter what your budget, there will likely be a game you can sponsor. The bigger your budget, the better your game. Performance can be tracked, and you can see how much traffic an in-game link is generating, but promotion isn't limited to links, as you can add other contact details such as a phone number if appropriate.
If you have any type of business that will benefit from more traffic being driven to your site, and a game can be made that is related in some way, Flash games are another marketing option that should certainly be looked into.
Unless you are running a gaming-related site, sponsoring a pre-made game through sites such as Flash Game License is not the best method. Custom made or modified advergames are more cost effective unless you come across a game that just happens to fit perfectly with your business, and are able to buy it at a viable price.