Mordeth
Mordeth was the councillor whose evil brought Aridhol to its doom. As far as we know, he was an actual person at the time of the Trolloc Wars. He was the power behind the throne of Balwen, and led Aridhol to the policy of "The victory of the Light is all....while their deeds abandoned the Light." When the city was consumed by its own evil, only Mordeth remained, bound to Shadar Logoth. One supposes that at some point he died, leaving his spirit to haunt the ruins. Mordeth's way out was to convince someone "to accompany him to the walls, to the boundary of Mashadar's power, [where he was] able to consume the soul of that person." That person was Fain, and it didn't quite work out that way, due to the DO's influence on Fain. Anyway, Mordeth no longer haunts Shadar Logoth, he is inside Fain, merged with him. [TEOTW: 19, Shadow's Waiting, 244]
Mashadar
Like Mordeth, Mashadar is connected with Shadar Logoth. However, Mordeth and Mashadar are NOT the same. Mordeth is/was a sentient being, an individual. Mashadar is some sort of physical manifestation of the evil nature of the city: "No enemy had come to Aridhol but Aridhol. Suspicion and hate had given birth to something that fed on that which created it, something locked in the bedrock on which the city stood. Mashadar waits still, hungering." [TEOTW: 19, Shadow's Waiting, 244] In particular, Mashadar is a slightly glowing fog. "Mashadar. Unseeing, unthinking, moving through the city as aimlessly as a worm burrows through the earth. If it touches you, you will die." [TEOTW: 20, Dust on the Wind, 249] It is not sentient. It just moves around and kills whatever it touches, in a rather painful fashion, if Liah's reaction to being touched by it in [ACOS: 41, A Crown of Swords, 660] is any indication. Mashadar, or something similar to it, may have existed prior to the Trolloc Wars. In [TEOTW: 50, Meetings at the Eye, 628], Aginor refers to the Shadar Mandarb, or the taint on it, as "An old thing, an old friend, an old enemy." [ACOS book signing: Vancouver, 24 August, 1996; report by Lara Beaton], RJ said that Mashadar appeared after everybody in Aridhol had killed one another.
Machin Shin
The Black Wind of the Ways. It is a part of the "Darkening of the Ways": "About a thousand years ago, during what you humans call the War of the Hundred Years, the Ways began to change....they grew dank and dim...some who came out had gone mad, raving about Machin Shin, the Black Wind." [TEOTW: 43, Decisions and Apparitions, 545] People who run into the Black Wind end up mad, or a mindless husk like the Ogier in [TGH: 36, Among The Elders, 435]. After TEOTW, Machin Shin gained a new feature: it somehow seeks out Rand. Whenever Rand tries to use the Ways, Machin Shin is found at the Waygate he is using. Note that this ONLY happens to Rand. When Liandrin, etc use the ways in TGH, and when Perrin does in TSR, they do not find the Black Wind waiting for them at the Waygate. This new effect is probably somehow due to its encounter with Fain in TEOTW. It seems to have picked up Fain's drive to seek out Rand. Note that it is probably NOT under Fain's control; Fain wanted Rand to follow him to Falme, but Machin Shin prevented him from doing so.
Where did the Black Wind come from? Nobody really knows. Moiraine makes some speculation in [TEOTW: 45, What Follows in Shadow, 576]: "Something left from the Time of Madness, perhaps....Or even from the War of the Shadow, the War of Power. Something hiding in the Ways so long it can no longer get out. No one, not even among the Ogier, knows how far the Ways run, or how deep. It could even be something of the Ways themselves. As Loial said, the Ways are living things, and all living things have parasites. Perhaps even a creature of the corruption itself, something born of the decay. Something that hates life and light."
Some people believe that Mashadar and Machin Shin are somehow connected, that Mashadar somehow got into the Ways through the Shadar Logoth Waygate and then became the Black Wind. This is very unlikely, for the following reasons: 1) Mashadar dates from the Trolloc Wars, Machin Shin from the Hundred Years' War. That is about a thousand years' difference. Thus, the time scale does not agree. 2) Mashadar is a slow-moving glowing fog that kills everything it touches. Machin Shin is a black, howling wind that eats your soul, but doesn't kill your body. So, there is no similarity of appearance, or effect. 3) If Mashadar could get into the Ways from Shadar Logoth, logic says it could get out of the Ways at some other point, and spread itself across Randland. This clearly hasn't happened.