The Shulchan Aruch writes (94:1) that while praying the Amidah one should face towards the direction of Israel. In the United States, which is to the west of Israel, one faces towards the east. For this reason, synagogues generally position the Heichal on the eastern wall, so that everyone will be facing the Heichal as they recite the Amidah.
In some synagogues, however, the Heichal cannot be situated on the eastern wall, due to either architectural logistics or other reasons. The Mishna Berura (commentary to the Shulchan Aruch by Rabbi Yisrael Meir Kagan, the "Chafetz Chayim," Lithuania, 1835-1933) writes (94:8) that if the Heichal is positioned along a different wall, one should nevertheless face towards Israel as he recites the Amidah. Therefore, a synagogue that cannot place the Heichal on the eastern wall should place it on either the northern or southern wall. It should not be positioned along the western wall, because the congregants will then have to turn their backs to the Heichal while reciting the Amidah.
The Mishna Berura (94:10) adds, however, that if a person prays in a synagogue where the Heichal is not positioned facing Israel, but the congregants nevertheless pray facing the Heichal, rather than towards Israel, he should likewise face towards the Heichal. Facing in a different direction than the other worshippers in the synagogue would not be appropriate, and therefore in such a case one should face towards the Heichal, but turn his head towards the direction of Israel.
A person who enters a synagogue to pray should not necessarily assume that the Heichal is positioned in the direction of Israel. As mentioned, some synagogues position the Heichal on a different side due to either logistical concerns or an oversight, and therefore one should ascertain before beginning the Amidah which direction he must face.
Summary: When reciting the Amidah, one faces towards the direction of Israel, which, in the United States, is to the east. If the Heichal in a synagogue cannot be positioned on the eastern wall, it should be placed along either the northern or southern sides. In such a case, the Amidah should be recited facing east, and not towards the Heichal, but if everybody in the synagogue faces the Heichal, one should face that same direction and turn his head towards the east.