From R. Eli Mansour's Daily Halacha for July 11, 2011 (http://www.dailyhalacha.com/Display.asp?ClipID=2163)
The Mishna Berura (Rav Yisrael Meir Kagan of Radin, 1839-1933) discusses the proper protocol for bidding one’s fellow farewell (110:17). If a person bids somebody farewell in English, it is customary to extend pleasant greetings such as, “Have a good trip” or “Enjoy,” and we sometimes use the Arabic expression for “G-d be with you.” However, the Mishna Berura - Rabbi Yisrael Meir Kagan, the Chofetz Chaim (Poland, 1838–1933) - writes that if one bids his fellow farewell in Hebrew, then he must be very particular in the words he chooses. Namely, he should say, “Lech Le’shalom” (literally, “Go to peace”), and not “Lech Be’shalom” (“Go in peace”). The phrase “Lech Le’shalom” (לך לשלום) implies that the person should find peace at his destination, and this is certainly the kind of wish we would like to extend to our fellow. However, the expression “Lech Be’shalom” (לך בשלום) is used at funerals, Heaven forbid, when we bid farewell to the deceased in front of the coffin. It means that the deceased leaves the world after having completed the mission for which he was sent here. Quite obviously, we do not wish to make such a statement to a living person, and this expression should therefore not be used when bidding farewell to a living person.
This Halacha is alluded to in the Torah, in the description of the tensions that arose between Yosef and his brothers. The Torah relates that the brothers were unable “Dabero Le’shalom” (literally, “to speak with him peacefully” – Bereshit 37:4). Because of their feelings of animosity toward him, they were unable to extend to him the kind greeting of “Le’shalom” which people should use when bidding each other farewell.
Clearly, however, if a person mistakenly wished his friend “Lech Be’shalom,” the friend should not feel anxious or concerned about what this expression might portend. Our Rabbis teach us that if one disregards superstition, then it will not have any effect on him. Rather than worrying about any harmful effects of the greeting, he should politely explain to his friend that Halacha advises people to say “Lech Leshalom,” instead of “Lech Be’shalom.”
Summary: If a person bids farewell to his fellow in Hebrew, he should say “Lech Le’shalom” and not “Lech Be’shalom.”
R. Mansour's Daily Halacha is available by email subscription at http://www.dailyhalacha.com