Jude spoke of the error of Balaam (Jude 1:11), which was that one could manipulate God into cursing those he has blessed. Revelation tells us about the doctrine of Balaam (Revelation 2:14), which concerned getting Israel to worship Baal of Peor instead of or as though he were the God of Israel. However, Peter’s epistle concerns itself with the way of Balaam or the **method** he used to deceive Israel into doing what he wanted done. In 2Kings 18:18-21 Elijah, the prophet, confronted King Ahab of Israel who had sent out the prophets (teachers) of Baal into all the tribes of Israel. In doing so, he was able to corrupt Israel and draw them away from the God of Israel. This is what Balaam did by telling Balak to send women (prophetesses) into the camps of Israel to deceive them into following after the ways of Baal, rather than the ways of God.
By pointing to the way of Balaam, Peter means to show that the women of Midian, mentioned in book of Numbers, answer to the false teachers of 2Peter who operated in Asia Minor. They were sent into the churches of Asia Minor by another authority, which I have concluded to have resided in Jerusalem, in order to accomplish the will of that authority rather than the will of Christ.
The false teachers had forsaken the right way, which is Jesus (John 14:6). Of course, this doesn’t mean they were disciples who had later forsaken their Lord, but it does mean that these men knew about the Gospel. Nevertheless, they had no value for Jesus as their Messiah, so they forsook him, not because they tasted him, but because they valued something else. John tells us that “they went out from us, but were not of us” (1John 2:19). That is, these men probably had been present with the brethren during worship meetings, but they didn’t number themselves as worshipers of Christ. James had written earlier to believers who had similarly been affected by false teachers. He wrote that they went out from us, but those men didn’t receive instructions from the leaders of the church in Jerusalem (Acts 15:24). That is, those who went out from the church in Jerusalem unsettled the brethren in other cities, but they, who did so, were not sent by James for that purpose.
The false teachers had erred, being deceived (planao –G4105) themselves. The Greek word used by Peter is the same word used by Christ in Mark 12:24 and by Paul in 2Timothy 3:13. If we consider that such men as a rule are cast into darkness by God (cf. 2Peter 2:4, 17) and apply that to what Jesus said in Matthew 15:14, we are able to see that false teachers are spiritually blind but were used ultimately by God (Romans 8:28) to weed out the blind from the followers of Christ (Matthew 15:13). That said, such “servants” are ruled by greed (2Peter 2:14). Not only will they root up those who are not Christ’s yet dwell among the believers, but they will also root up the people of God with the servants of the evil one (2Peter 2:14; cf. Matthew 13:24-30).
The authorities at Jerusalem during the first century AD had followed after the way of Balaam by sending spies into the churches of God in order to bring believers into bondage to them (2Peter 2:15; cf. Galatians 2:4), because that way appealed to their natural lust for the wages of unrighteousness (2Peter 2:13). A quick material gain is very often preferred over a spiritual gain that takes time to develop and mature. Notice that Balaam was rebuked by a dumb (mute) ass. That is, the prophet who acted against reason (acting against God had cast him into darkness – cf. 2Peter 2:4) was rebuked by an animal that had no reason at all. Light was more easily put into the mouth of an unreasonable beast, than it could be put into the heart of the foolish prophet, who thought he could manipulate God.
 Recent discoveries in science shows that people (usually military) are able to send a signal (sometimes referred to as Microwave Auditory Effect) miles away and cause it to speak in the head of a target person. That person, unaware of what is taking place, believes he hears a voice inside his head. Something similar to this was probably how God caused the ass to speak to Baalim.