Right now the election is too close to call. There are 538 total electoral votes and 270, a simple majority, are needed to get someone elected. It is technically possible for the election to end in a tie, with Obama and McCain each getting 269 electoral votes, one shy of the majority needed to be president. If that happens, then the election of the president is up to the House and the vice president up to the Senate.
Each state delegation is expected to vote according to their party affiliation but each state only has one vote in the total votes cast. Thus the House would vote for Obama since there is a clear House majority of Democrats. In the Senate there is a tie between Democrats and Republicans, each with 59 members, while two other Senators are independents. Joe Lieberman, a very close friend and endorser of McCain, is an independent who joined the Democrats to give the Democrats control of the Senate.
Because of Lieberman's support of McCain the Senate democratic leadership have threatened to strip him of any party rank in the new Senate. So if the vice president is to be decided by the Senate, Lieberman could easily change his vote, thus eliminating the Democratic majority. If he cast his vote for Palin it would decide the election.
The result would mean Obama would be president and Palin would be vice president for the next four years and given an electoral tie there would be no other probable conclusion. With the polls closing as expected in these last days such a scenario becomes more and more possible. There are so many firsts in this election, not to mention worldwide economic catastrophes and other strange circumstances, that a result as I outlined may not be so far fetched.
Here is what the Constitution says about the election of the president and vice president in Article II and the procedure is quite clear.
Article II
Section 1. The executive power shall be vested in a President of the United States of America. He shall hold his office during the term of four years, and, together with the Vice President, chosen for the same term, be elected, as follows:
Each state shall appoint, in such manner as the Legislature thereof may direct, a number of electors, equal to the whole number of Senators and Representatives to which the State may be entitled in the Congress: but no Senator or Representative, or person holding an office of trust or profit under the United States, shall be appointed an elector.
The electors shall meet in their respective states, and vote by ballot for two persons, of whom one at least shall not be an inhabitant of the same state with themselves. And they shall make a list of all the persons voted for, and of the number of votes for each; which list they shall sign and certify, and transmit sealed to the seat of the government of the United States, directed to the President of the Senate. The President of the Senate shall, in the presence of the Senate and House of Representatives, open all the certificates, and the votes shall then be counted. The person having the greatest number of votes shall be the President, if such number be a majority of the whole number of electors appointed; and if there be more than one who have such majority, and have an equal number of votes, then the House of Representatives shall immediately choose by ballot one of them for President; and if no person have a majority, then from the five highest on the list the said House shall in like manner choose the President. But in choosing the President, the votes shall be taken by States, the representation from each state having one vote; A quorum for this purpose shall consist of a member or members from two thirds of the states, and a majority of all the states shall be necessary to a choice. In every case, after the choice of the President, the person having the greatest number of votes of the electors shall be the Vice President. But if there should remain two or more who have equal votes, the Senate shall choose from them by ballot the Vice President.
Amendment XII
The electors shall meet in their respective states and vote by ballot for President and Vice-President, one of whom, at least, shall not be an inhabitant of the same state with themselves; they shall name in their ballots the person voted for as President, and in distinct ballots the person voted for as Vice-President, and they shall make distinct lists of all persons voted for as President, and of all persons voted for as Vice-President, and of the number of votes for each, which lists they shall sign and certify, and transmit sealed to the seat of the government of the United States, directed to the President of the Senate;--The President of the Senate shall, in the presence of the Senate and House of Representatives, open all the certificates and the votes shall then be counted;--the person having the greatest number of votes for President, shall be the President, if such number be a majority of the whole number of electors appointed; and if no person have such majority, then from the persons having the highest numbers not exceeding three on the list of those voted for as President, the House of Representatives shall choose immediately, by ballot, the President. But in choosing the President, the votes shall be taken by states, the representation from each state having one vote; a quorum for this purpose shall consist of a member or members from two-thirds of the states, and a majority of all the states shall be necessary to a choice. And if the House of Representatives shall not choose a President whenever the right of choice shall devolve upon them, before the fourth day of March next following, then the Vice-President shall act as President, as in the case of the death or other constitutional disability of the President. The person having the greatest number of votes as Vice-President, shall be the Vice-President, if such number be a majority of the whole number of electors appointed, and if no person have a majority, then from the two highest numbers on the list, the Senate shall choose the Vice-President; a quorum for the purpose shall consist of two-thirds of the whole number of Senators, and a majority of the whole number shall be necessary to a choice. But no person constitutionally ineligible to the office of President shall be eligible to that of Vice-President of the United States.