The Horus Heresy was the fictional event that defined the current era in Games Workshop's Warhammer 40K setting. It refers to Horus's corruption by Chaos and the revolution he started, approximately 30000 AD.
The Primarchs, the "sons" of the Emperor of Mankind and the leaders of the space marine Legions, were all, in theory, brothers, all equal (if not identical) in status and ability. It was clear, however, that the favored son was Horus.
Horus was one of the first Primarchs to be reunited with the Emperor, and it soon became clear as the First Crusade went on that his talents lay in the the leadership of men. Horus took a leadership role in even collaborative efforts, and such roles were freely conceded to him, as he led his brothers to even greater accomplishments than they would have achieved on their own. He matched the fury of Leman Russ's Space Wolves where the shock would have more of an impact than the damage, and matched Perturabo and the Iron Warriors' caclulating precision with surgical strikes.
Of course, this talent for leadership came with a dark side, as Horus was a master of manipulation, as well.
At some point in the First Crusade of the Imperium, Horus was called back to Earth to receive the due reward for his accomplishments, a title of Imperial Warmaster, an unprecedented honor. However, fate intervened on the way back to Terra. On Davin, an unimportant feral world, Horus fell ill, and was found by members of a secret warriors' lodge, who returned him to health, and indoctrinated him. Since it was common practice to embrace such warrior lodges and cults and extend their beliefs to incorporate Emperor-worship, this was hardly uncommon. Nobody knows what this lodge taught him, or promised him, but it's apparent that the lodge was a front for Chaos, because Horus left Davin as if possessed. He encouraged similar "warrior lodges" in the Legions under his direct command: Horus's own Lunar Wolves (by then the Sons of Horus), Angron's bloodthirsty World Eaters, Lorgar's fanatic Word Bearers, Night Haunter's cruel Night Lords, and Perturabo's heartless Iron Warriors, as well as corrupting many Imperial Guard garrisons and a large portion of the Adeptus Mechanicus. These "lodges" would later be revealed to be Chaos covens, simply tools for the corruption of the other Legions, but, for the time being, all was apparently well.
All was well, of course, until Istvaan III declared its independence. Istvaan wasn't an important system, by any means, and the decision by the Administratum to send Horus to reclaim control was routine. That was what the space marines were for, anyway. What was not routine, however, was the fact that Horus chose this moment to make his rebellion known, virusbombing Istvaan III, sacrificing every living thing on the planet to Chaos. (The death of these 12 billion would become known as the Scouring of Istvaan.) Of the few loyalists, only a handful escaped, commandeering the Eisenstein, a cruiser, and speeding for Terra with news of Horus's betrayal.
This was apparently a sign, because immediately after the news reached Terra, the Adeptus Mechanicus and Imperial Guard loyal to Horus rose up in rebellion. The Titan Legions were especially affected, as Horus had managed to corrupt all but the legions defending Terra and Mars. In many cases, the builders of a titan would consecrate it, then lead it directly into battle, due to the lack of loyal crews.
The Emperor's first response to this was to send the remaining loyal Legions to Istvaan V, Horus's new base, to crush this insurgency, but of the first wave of Marines, only a handful survived, barely escaping with the geneseed of their fallen brothers. As these stragglers reached the "safety" of the second wave of attackers, they found themselves under attack again, this time from their erstwhile rescuers.
Horus had corrupted more than half of the Legions sent to oppose him, adding the Thousand Sons, Death Guard, Alpha Legion, and Emperor's Sons to his ranks. With these additions to his ranks, and his near-total control of the Legio Titanicus, he felt it was time to make his move.
These seven Legions, the cream of the Legio Titanicus, a large portion of the corrupted Imperial Fleet, the largest host of demons since the Fall of the Eldar, and sundry other forces converged on Terra, crushing Luna base and the perimeter defenses of Terra, rapidly establishing a beachhead on the planet, and slowly, but surely, forcing the defenders back, until only the tide of Chaos lapped against the walls of the Inner Palace, the last bastion and the home of the Emperor's throne, as the Blood Angels, White Scars, Imperial Fists, Adeptus Custodes (the Emperor's personal guard), and the loyalist Titan Legions threw themselves into the defense, knowing that if they failed, every single soul in the Palace or elsewhere would be damned. Even the breach of the Palace walls by the Iron Warriors wasn't enough to damp the loyalists' spirit.
As the siege dragged on, as reinforcements in the form of the Ultramarines and Space Wolves drew nearer and nearer to Terra, as the population of Terra was slaughtered and the Imperium turned on itself, both the Emperor and Horus both independantly realized that the battle for the Palace was a pointless stalemate, and continued fighting would only weaken them both. As the Emperor disconnected himself from the Astronomicon, Warmaster-cum-would-be-usurper Horus lowered the shields of his battle barge, allowing the Emperor (as well as Rogal Dorn and Sanguinius) to beam himself aboard.
The Emperor raged through Horus's flagship, slaughtering the traitors and bellowing for Horus to challenge him. However, Sanguinius was the first confronted by Horus. Sanguinius, while a master swordsman and a Primarch in his own right, was no match for Horus at the peak of his Chaos-granted powers, but was struck down, but only after opening a flaw in Horus's defenses.
The final meeting of the Emperor and his most favored son saw the Emperor charging to meet Horus, reveling in his corrupt glory, still standing over the broken body of Sanguinius. However, even the power of the greatest of the Primarchs, coupled with the blessings of the Chaos Gods, wasn't a match for the fury of the Emperor of Man, and Horus was slain. But not without a price. Not only was Sanguinius dead, but the Emperor was left dying of his wounds.
Rogal Dorn found the Emperor, and teleported him back to the Palace, where the death of Horus had seemed melt the alliances holding the traitor Legions together. All at once, they were squabbling and infighting, and the lack of cohesion, along with the all-too-late arrival of the Space Wolves and Ultramarines, meant that Terra was reclaimed, and the forces of Chaos, by and large, were forced to the Eye of Terror, as per the Emperor's final edicts.
The dying Emperor was ensconced in the Golden Throne, where he rests to the present day, and Roboute Guilliman, Primarch of the Ultramarines, wrote the Codex Astartes, but those are noded elsewhere.
See also: space marine, Blood Angels, Golden Throne
Sources: Realm of Chaos - Slaves to Darkness, by A. R. Fawcett, numerous issues of White Dwarf, and my own shaky memory of both Chaos codices