Anathema:
Something to be despised, hated, cursed, execrated. The word was used of a thing that was horrible and/or horrifying. The thing or person anathematized was marked for expulsion, destrucyion, ruin. (Deut 7, 1 Kings 15:9-23) Anyone who spared an anathematized thing became himself anathema; however destruction was not always total. (Num 31:18, Josue 6:17) In the NT, anathema no longer implied death, but the loss of some or all goods or exclusion from the society of the faithful. (Rom 9:3, Gal 1:9) This seperation from the faithful and from holy things implied the union with the devil chosen by the offender. The church took the term at an early date to signify the exclusion of a sinner from the society of the elect in the sense of an excommunication. The purpose of the censure was to vindicate justice, deter others from crime, shock the offender with a sense of the magnitude of his sin, and finally bring him to repentence.
Excommunication.
I have a long drawn-out definition for this, but suffice it to say that excommunication is imposed when a person commits certain sins, knowing full well that the sin is excommunicatable, such as hearing confession when not a priest, profaning the Eucharist, etc. A person who is excommunicated must gain absolution not only for the sin but also for the excommunication. In some cases, absolving the excommunication can only be done by a Bishop or the pope. Usually when a priest is the confessor, he must obtain from his deisgnated superior the faculties to absolve the penitent.
In short, Anathema is something intolerable to the faith, Excommunication is the (hopefully temporary) exclusion of a sinner from communion with the faithful.
Thal59