There are disputes over this issue, particularly over whether Ronald Reagan or Mikhail Gorbachev was more responsible for the fall of communism. I would argue that Reagan and Gorbachev's actions were proximate causes. The real root cause of this collapse was the fact that the Soviet system could not provide for the material or political desires of its citizenry.
The Soviet system was very inefficient. It was not able to produce enough goods and services to give its people a good standard of living. At the same time, the political system was very repressive. It did not afford people the ability to have their voices and their frustrations heard in any meaningful way. This meant that a great deal of dissatisfaction had built up in the populace of Eastern Europe by the 1980s. When Gorbachev instituted his reforms and/or when Reagan put more pressure on the Soviets by ratcheting up the arms race, the communist system collapsed.