The Prime Minister said the session was expected to herald in a new hope for India.
"Today the monsoon session begins. Like the monsoon brings hope, this session also brings the same spirit of hope," Modi said before casting his vote.
Shah, who is an MLA from Gujarat and was allowed to cast his vote in Parliament, also used his franchise.
All elected MPs and members of legislative assemblies are eligible to vote and elect the successor of Pranab Mukherjee, who demits office on July 25.
The contest is between National Democratic Alliance (NDA) nominee Ram Nath Kovind and candidate of several major opposition parties Meira Kumar, who was former Lok Sabha Speaker.