12:7 One should always try to pray with a minyan, which is considered “an auspicious time” (“eis ratzon”). This is reflected in a number of places in Tanach, including Isaiah 49:8, where God says “’I will answer you at an auspicious time,” i.e., when we pray together as a community. God will not reject the prayers of the community, even though there may be evil people among them. Again, there are numerous sources to support this, such as Psalms 55:19, in which David states that God rescued him “in peace from the battle that was against me because of the many who were with me.” The Mishnah Brurah (90:28) is quick to correct a common misconception: the main reason to pray with a minyan is to be able to say Shemoneh Esrei together, not to respond to such things as Kaddish and Kedusha. Therefore, one must not be lax when it comes to having a minyan for its primary purpose.
12:8 If a traveler reaches a place where he might spend the night but there is a place with a minyan within four mil (about 2.5 miles) that he can reach before nightfall, he must press on. Similarly, he must go back 1 mil (about .6 miles) in order to pray with a minyan. (Mishnah Brurah 90:52 says that the requirement to travel one mil for a minyan also applies to those sitting at home.) A person should also not leave the place with a minyan if he can stay to pray together with them and still reach his destination on time.