The June Offensive
During the 'Summer of Discontent', the Provisional Government's not so bright idea to launch an attack on the Austro-Hungarian army - known as the June Offensive - was a disaster. Kerensky - the current prime minister - would be so popular if they won he'd probably be made leader of the country. Unluckily for him, it resulted in mass desertions of the army and the overall breakdown of discipline.
Lenin used this to plan a bid for power.
The July Days
Then came the July Days, where demonstators marched through cities chanting 'Peace, Bread and Land', and 'All Power to the Soviet' - Bolshevik slogans.
The July Days also didn't work out too well - they lacked leadership, and proved a major setback to the Bolsheviks. The Bolsheviks were blamed, and they went into hiding. Lenin was labelled as a German spy by Kerensky, due to his previous return to Russia on a German train with German funding. (Lenin's April Theses <- make sure you know what that is!!!).
The aftermath was an empire on the verge of chaos.
Peasants were seizing land for themselves, industrial production was failing and soldiers were deserting their duties.
The Kornilov Affair
When Kornilov, commander-in-chief of the army, ordered Russian troops back into Petrograd, Kerensky panicked, fearing a military takeover.
Having lost the support of the army, Kerensky, for some reason, turned to the Soviet for their help. They refused to help unless the arrested members of the Soviet were freed - and so Kerensky did just that. He released many members of the Soviet, including several Bolsheviks. He also gave them weapons.
The Soviet did convince Kornilov not to attack, but now the Bolsheviks were armed.
Kerensky was isolated.