Odinga is seeking the presidency for the fifth time and has campaigned on an anti-corruption ticket.
Ruto has pledged far-reaching economic reforms to improve a lot of small businesses and farms.
Rising food and fuel prices have added to tensions in the large country, which is home to a wide range of ethnic groups.
Past elections have often been characterized by outbreaks of violence
Kenya is nevertheless seen as a relatively stable country on the continent, and the two main candidates have indicated they intend to accept the election result.
They have also said they plan to continue close relations with the United States and the European Union.
Under the constitution, results must be published within seven days.
With four candidates running, and a close result expected, a run-off election may well be necessary.
The election in the country of some 56 million inhabitants is the fifth presidential election since independence from Britain in 1963.
Members of the National Assembly and Senate were also chosen on Tuesday