Looking at Marsh v. Chambers as suggested by Avi, the precedent for the Congressional prayer appears to be in part that a prayer was held in the First Congress' session, which drafted the First Amendment. Thus, because a prayer was held before the Establishment Clause was ratified, the drafters must not have intended for it to prohibit a prayer before legislative sessions. According to the ruling, since it is now precedent and appears not to contradict the intention of the drafters, it is permissible:
In light of the history, there can be no doubt that the practice of opening legislative sessions with prayer has become part of the fabric of our society. To invoke divine guidance on a public body entrusted with making the laws is not, in these circumstances, a violation of the Establishment Clause; it is simply a tolerable acknowledgment of beliefs widely held among the people of this country.
I think the justification for the US Motto ("In God we Trust") and including "One Nation Under God" in the Pledge of Allegiance are also helpful. There's some case law in both of those links, but both tend to point to Aronow v. United States, which ruled in favor of allowing the use of the word "God" in the motto. Wikipedia has this excerpt from the ruling:
It is quite obvious that the national motto and the slogan on coinage and currency 'In God We Trust' has nothing whatsoever to do with the establishment of religion. Its use is of patriotic or ceremonial character and bears no true resemblance to a governmental sponsorship of a religious exercise. ...It is not easy to discern any religious significance attendant the payment of a bill with coin or currency on which has been imprinted 'In God We Trust' or the study of a government publication or document bearing that slogan. In fact, such secular uses of the motto was viewed as sacrilegious and irreverent by President Theodore Roosevelt. Yet Congress has directed such uses. While 'ceremonial' and 'patriotic' may not be particularly apt words to describe the category of the national motto, it is excluded from First Amendment significance because the motto has no theological or ritualistic impact. As stated by the Congressional report, it has 'spiritual and psychological value' and 'inspirational quality.
The same logic can be applied to a prayer which affirms faith in God as "ceremonial" and thus holding no theological or ritualistic impact. This may be why the Senate site is careful to say that they separate Church and State, but not God and State - specifying a particular theological version of God (e.g. the Christian God) could be challenged as making the prayer "theological" in nature.