There are a few things that will cause the 502 Bad Gateway error
.
1. There are issues with your service provider's traffic; could be experiencing high traffic or an overabundance of bandwidth hogs or even maintenance.
2. There is an issue with the server we are located on, failing hardware or lack of capacity.
3. There is an issue in communication between websites; server and the gateway/proxy do not agree on the protocol for exchanging data.

In most cases a 502 Bad Gateway error will clear up on its own within a few hours but that's usually only if the culprit is #1 :S