You can get any number of missionaries at the faith purchase level associated with your current era (e.g., 300 in renaissance), while great prophets escalate in cost with each purchase (like other great people, albeit using a dedicated counter). So, I tend to purchase missionaries until (1) missionaries get too expensive for their value (and with Great Mosque, that value is increased by 50%, which is one reason why the AI seems to prioritize the Great Mosque over Hagia Sophia) and/or (2) I'm trying to get my religion into cities with an already established religion, where missionaries barely make a dent, but prophets roll.
In the latter case, if you have the research-boost-when-missionaries-spread belief (forget what it's called), where you are essentially turning faith into beakers, then missionaries remain viable for longer. But, since the faith-to-beakers ratio can get pretty poor late in the game as missionaries get more expensive, you can switch to prophets -- they also benefit from the science boost. But, being a prophet, they can't perform the same mission as conveniently as a missionary. With a missionary, as long as you have open borders, you can camp out next to a rival holy city with a big pop and bulb away -- the AI won't care (since your conversion efforts are futile) and you can then do it again the very next turn without having to trundle off to another city. With prophets, since they wipe clean the target city's religion, you have to move on to find another city, and in the meantime the AI is going to get real grumpy, real fast.
Also, I find that the missionary science benefit works best for non-science games. If you have opened Rationalism and are aiming for a science victory, you may well be better off saving faith to buy great scientists than spamming missionaries for smaller amounts of beakers throughout the game.