IT HAS BEEN, fortunately, a bad summer for Moammar Gadhafi. Chad, a country the Libyan leader has tormented for years, spent August reducing his army and prestige to tatters. Showing that its victory of last March was no freak, the government of Hissene Habre took back the disputed Aozou border strip that Libya had annexed 14 years earlier. Chad then carried the war to Libyan soil for the first time, devastating a base from which Col. Gadhafi had launched his depredations.

It is the case that Chad's armed forces had help in becoming more than the ragtag band of one of the more impoverished and tribally divided countries in Africa. The French, playing a discreet and useful patron's role, have armed and trained their former colony and have kept some of their own men and forces on the ground as well. The United States has provided lesser amounts of military aid. Still, there need be no apologies: all of this foreign stiffening did no more than put Chad in a position to defend itself against a government that is led by a certified rogue and armed, massively, by the Soviet Union.

The war has even produced its own black humor. Retaliating against the recent thrust into Libyan territory by Chad, Libya set out to bomb Chad's capital of Ndjamena -- 600 miles behind the border. French air defense forces shot down one of the bombers, whereupon the Libyans denounced those with the effrontery to ''resist'' its bombers. In fact, the French have been careful to limit their mission in Chad; they did not approve of the military reconquest of Aozou, and they separated themselves from Chad's in-and-out incursion into Libya proper.

In matters involving Col. Gadhafi, it is prudent to be wary. He has not been altogether reduced to size. But the fact is, it has been downhill for him since the United States responded to his association with international terrorism and launched its air attack of April 1986. Chad added useful insult to this injury. To be bombed by a great power was one thing -- although there was for Libya the additional sting of having the act condoned by most of those it had expected to protest. To be humiliated by a seemingly puny and helpless victim is quite another thing. Other countries he has despoiled, mesmerized and intimidated will notice