We are not to swear by a pagan deity, even when speaking to its adherents. Furthermore, we are not to encourage the idol’s worshippers to swear by it either, as the verse continues, “your mouth shall not cause it to be heard.” (Even though the idolators believe in the power of the idol and such an oath may be a sign of their sincerity, it’s still not acceptable for us to be involved in bringing it about.)
The Talmud in Avodah Zara 6a discusses a prohibition against doing business with idolators within three days of their festivals. Rashi there says that the reason is that we don’t want to cause the idolator to praise his deity, which would be a violation of “do not cause it to be heard.”
You may wonder why we care if our actions cause non-Jews to praise their idols. After all, we don’t try to stop non-Jews from wearing shaatnez or eating non-kosher meat. In fact, it’s permissible to give or sell non-kosher meat to a non-Jew! So if they’re going to praise their idols anyway, you may wonder what that has to do with us. It’s simple: non-Jews are also commanded not to worship idols! The prohibition against idolatry is one of the seven universal (Noachide) laws so, to some degree, idolatry is everybody’s business. We may not be able to prevent it, but we certainly shouldn’t help bring it about!
Not only may we not swear in the name of an idol (or cause others to do so), we may not mention the names of idols in other contexts. For example, one may not use them by name as a point of reference when giving directions. (It is, however, permissible to mention idols named in the Torah, such as Baal Tzfon or Baal Pe’or.)
This mitzvah is in effect in all times and places for both men and women. In the Talmud, it can be found in the tractate of Sanhedrin (63b). In the Shulchan Aruch, it is codified in Yoreh Deah 147. It is #14 of the 365 negative mitzvos in the Rambam’s Sefer HaMitzvos and #13 of the 194 negative mitzvos that can be fulfilled today as listed in the Chofetz Chaim’s Sefer HaMitzvos HaKatzar.