An Imam means leader..
So it can have different contexts..
The person who leads the prayer is an imam.. anyone can really do that providing they know how..
But that doesn't necessarily mean they can be an Imam in a mosque, for that they need to have reached a certain level of understanding of Islam, so that they are able to answer questions, give religious instruction and deliver sermons. They can be known as a sheikh.
A mufti generally is a name that is designated to someone who has a position of authority being to make fatwas.. generally a grand mufti is the highest ranking Islamic Authority in the land and along with the other mufti's consult with the government on religious issues..
http://slate.msn.com/id/2098364/So You Want To Be an AyatollahHow Shiite clerics earn the name.
By Brendan I. KoernerPosted Tuesday, April 6, 2004, at 6:11 PM ET
Muqtada Sadr, the Shiite cleric whose supporters are attacking U.S. troops in Iraq, has yet to attain the title of ayatollah. According to the New York Times, Sadr is "several ranks and many years away" from earning that honorific. How does a garden variety Shiite cleric become an ayatollah?
Through decades of outstanding scholarship, which in turn inspires the devotion of hundreds of thousands, if not millions, of followers. The route to becoming an ayatollah ("sign of God" in Arabic) is quite unlike the path toward becoming, for example, a Catholic bishop. There is no ceremony in which the office is formally bestowed, nor any specific requirements a candidate must fulfill. Rather, clerics who prove their wisdom over years of studying, teaching, writing, and preaching slowly gather the respect of both Shiite elders and everyday practitioners.
A typical ayatollah's career takes him to one of the Shiites' holy cities, like Najaf in Iraq or Qom in Iran. There, he studies at one of the pre-eminent Shiite seminaries, where he is expected to become an expert in theology, jurisprudence, science, and philosophy. After years of distinguished study, he begins delivering lectures of his own, offering unique, insightful interpretations of Islamic texts. He starts to write well-received books on religious topics, and young students seek out his wisdom. Eventually, his fame spreads beyond Islamic academic circles, and many Shiite faithful regard the cleric as a marja' at-taqlid—"a source of emulation." Once the cleric has gathered a critical mass of followers (known as muqallid) and earned the respect of his elderly teachers, he is generally considered an ayatollah.
There are also a small number of grand ayatollahs, such as the Najaf-based Grand Ayatollah Ali Sistani, widely known as the most learned Shiite cleric in Iraq, if not the world. The process of bestowing the grand ayatollah title upon a cleric is a bit more formal. It is usually agreed upon by a council of Shiite elders, often connected to one of the primary hawzas, or network of Islamic schools. In 1992, for example, Sistani was selected to head the hawza in Najaf, the holiest of Shiite cities. (It is where Ali, the fourth caliph and the person whom Shiites believe was Mohammed's chosen successor, is entombed.) Sistani is renowned for his expertise in ijtihad, the application of Koranic values to contemporary issues; his Web site includes detailed ruminations on the religious correctness of playing the lottery, taking out a mortgage, and engaging in oral sex.
At just 31 years of age, Sadr is, indeed, nowhere near earning the requisite religious credentials to become an ayatollah. The authority he does have derives mostly from his familial connections, as his father was a respected ayatollah who was murdered by Saddam Hussein in 1999.