Answer:
A US congressman by the name of Charlie Wilson provided them with money and weapons, including hand held rocket launchers and anti aircraft weapons, by diverting US dollars to the country. With the anti aircraft weapons they were able to defeat the Soviets helicopters that were causing most of their losses. After a while it simply became too expensive for the Soviets to continue.