Middle Persian (Pahlavi) writing was essentially a cryptography. Not only had the deterioration of cursive writing made several groups of letters indistinguishable from each other, but the alphabet itself was ill suited to Persian to begin with, and last but not least a great many words were written in the totally unrelated Semitic language Aramaic, but read out as their Persian translation. See Wikipedia:Frahang-i Pahlavig.
During the post-Sassanian decline period fewer and fewer people even among the priests mastered this complicated writing system. The introduction of diacritical marks on the model of Arabic, Hebrew and Syriac writing was only a partial remedy, since it was in the first place only inconsistently employed and in the second place only addressed the issue of ambiguous letters, and but not the problems of words written in Aramaic or defectively written vowels. As a result the ability to accurately read and copy the translations (zand, "explanation") of the holy books into Pahlavi was in danger of being lost and with it the understanding of and preservation of religious literature
As a part of the restoration under king Narseh II the priest Neryosang therefore suggested that the Pahlavi religious books be transcribed into the phonetic script that had been devised during the Sassanian dynasty to preserve the holy text of the Avesta. This retranscription was known as Pazand, "appended explanation"). While this move was not primarily intended as a general writing reform, but as a means to prevent the loss of religious literature and knowledge it quickly made large segments of the literate class aware that it was possible to represent the spoken language in a clearer and more accessible way. Thus Narseh II's successor Bahram VIII decreed that all royal edicts (fārmāns) should be written in the Pazand script less they be misunderstood or perverted by careless or ignorant scribes. From then on Pazand writing gained more and more ground and eventually Pahlavi writing was abandoned.
While Pazand writing was easier to read it posed somewhat the opposite problem from Pahlavi writing: as Avestan script distinguished many more sounds than there were phonemes in contemporary Persian scribes often had several graphemes or graphies to choose between in order to render a single phoneme, and this multiplicity of choice together with the principle that Avestan words borrowed into the modern language should preserve their Avestan spelling made Pazand writing more complicated than it needed to be. This ambiguity has only been relieved by spelling reforms in recent times. While digraphic spellings of single vowels have been abolished and digraphic variation abandoned in words of modern form, Avestan words, of which there are plenty, are still written in their Avestan spelling, and moreover an etymologically based distinction between ē and ī, ô and ū is still observed even in Modern words, in spite of the mid long vowels having fallen together with the high long vowels in most dialects.
Persian is the official language in the form of one dialect or another in Persia (Farsi dialect), Moghul National Realm (Dari), the Tajikistan province of Turkestan (Tajik), and Azerbaijan (Azari). It is spoken also in Georgia, Armenia, and Turkey and by immigrant communities in Russia, Lebanon, Aragon, New Kingdom of Granada, Montrei, and Greece.