CNN’s web site has an electoral college map widget that lets you set states red or blue. Starting with the 2004 results, I changed New Mexico, Colorado, and Iowa to the Obama column (all leaning that way based on polls), and changed New Hampshire to the McCain column (a tossup). This amazingly plausible electoral result produces a 269-269 tie.
In the result of a tie outcome like this, the electors themselves do not necessarily adhere to their pledged candidates. However, if they do, the race is decided by the House of Representatives, but not by individual votes from each representative: each state gets one vote. California with its 53 representatives gets the same say as Wyoming with its 1.
Because Republicans control the more numerous small states and Democrats the less numerous, heavily-populated, states, this would result in a McCain presidency.