During the Trojan War, the Telamonian Ajax, or "Big" Ajax, was the bulwark of the Greek army. He was the largest of the Greeks, and often he fought next to his brother, the Oilean Ajax, or "Little" Ajax. In single combat, he battled Hector to a draw. Then, the two exchanged weapons. Hector gave him his sword, and Ajax his girdle. When Agamemnon sent an embassy to the sulking Achilles, Ajax was a member. During this time when the other great kings were hurt, Ajax continued to fight every day, holding off the Trojans as best he could.
When Achilles dies from an arrow shot by Paris, there is a huge battle for the corpse. Eventually, Odysseus and Ajax manage to carry it from the battle and back to the ships. Achilles is cremated, and his ashes are mixed with Patroclus'. As for Achilles' armor, made by Hephaestus himself, both Odysseus and Ajax claim it.
In order to prevent bloodshed, Odysseus proposes to let the other kings decide. Ajax agrees. He is certain that he will win, because he has fought so hard for so long, and he was closer to Achilles than Odysseus was.
When the two plead their cases before the judges, Odysseus is by far the better speaker. Ajax cannot match his eloquence. The armor then is awarded to Odysseus, and Ajax flees the camp in anger.
That night, outside the Greek camp, Ajax plans his revenge. He sneaks back into the camp, and begins to kill every Greek he sees. Athena has sent a madness upon him, however, and he is actually cutting down a herd of livestock. In the morning, he gloats over his victories, but eventually begins to realize what he has done. Completely disgraced, Ajax falls upon his own sword, which had been given to him by Hector when he was at the height of his glory.
After his death, Agamemnon and Menelaus refuse to allow Ajax to be buried. After Odysseus speaks on his behalf, however, the two relent. Later, when Odysseus visits the underworld in Book 11 of the Odyssey, Ajax, still angry in death, is the only Greek to refuse to speak to him.