Congress shall make no law respecting an establishment of religion, or prohibiting the free exercise thereof; or abridging the freedom of speech, or of the press; or the right of the people peaceably to assemble, and to petition the Government for a redress of grievances.The Fourteenth Amendment extends (federal) "Congress" to include the states(' legislatures), but nothing has changed "shall make no law". Actually, Clarence Thomas makes an argument that I have already previously made myself independently, namely that according to the literature of the Framers (see, for example, Justice Joseph Story's opinion), freedom of exercise was considered a universal human right, but freedom from a state-established church was not, and that therefore, if the Fourteenth Amendment extends protection of all liberties and rights (such as they were understood by the Framers) to the state-level, then, if we accept the consensus of what everyone considered to be rights at the time, states would be required to guarantee freedom of exercise but they would not be required to guarantee freedom from establishments. That is to say, the Framers recognized certain things as rights and certain things not as rights, and sometimes, they would say that something was a human right but that the federal Constitution had no power to force the states to respect that right; the Fourteenth Amendment changed this, by requiring states to recognize all human rights, but it did nothing to expand the list of rights beyond those recognized by the Framers. I would say, personally, that the Framers were wrong for countenancing state-level establishments, but they countenanced them nevertheless, despite my disapproval. According to this argument, the Fourteenth Amendment incorporated the "freedom of exercise" clause but not the "respecting an establishment" clause. But be that as it may. The argument I will make below, applies fully even if the entire First Amendment is incorporated without distinction. So let us just say, for the sake of argument, that the Fourteenth Amendment extends the entire First Amendment to the state-level; if so, then it extends (federal) "Congress" to include the states(' legislatures), but it does not affect "shall make no law".
Given that the First Amendment speaks only of laws, it obviously does nothing to restrict the private sphere. As for the other branches of government, viz. executive and judicial, it would seem to me that the First Amendment does not affect them. Rather, what would limit them, is any constitutional - whether federal or state - stipulations of their power.
If, for example, the Constitution were to specify that the president cannot do anything not provided in law ("the president's powers shall be limited to executing any laws already passed by Congress"), then he could not do anything religious, insofar as any religious law would be unconstitutional, and so the only way he could do anything religious would be to act according to something other than the law, and this hypothetical provision already said that he cannot do anything except for what is in the law. (Obviously, the First Amendment does not speak of things that are merely "religious". And even if it did, what does "religion" mean? Does a religion have to be theistic? I don't want to get into defining religion. Let's just speak of "religion" and "religious", without bothering to define what that means.)
That is hypothetical, of course, as no such constitutional provision exists. The point, however, is that what would limit the executive and judicial branches is their own constitutional stipulations of power, be whatever they may, but the First Amendment affects only the legislature and no one but the legislature.
For example, the federal Constitution states the president "shall from time to time give to the Congress Information of the State of the Union, and recommend to their Consideration such Measures as he shall judge necessary and expedient". Nothing there says that anything he states in the State of the Union, or any of his recommendations, must be in accordance with any other laws. So he can, apparently, say whatever on earth floats his boat. Congress cannot pass a law that favors or restricts religion, but apparently, the president could get up and read Jonathan Edwards's "Sinners in the Hands of an Angry God", and nothing would stop him, for Congress did not thereby pass a law, and the president did nothing contrary to his own personal stipulations of power. And if fact, if Congress passed a law banning the president from using the State of the Union address as an opportunity to hold a Christian revival meeting, that ban itself would violate the First Amendment!
So I ask: what law is there about prayers offered by a valedictorian? According to the First Amendment, any such religious expression, even by governmental officials, is permissible as long as there is no law mandating it. Only if some other express constitutional provision, outside the First Amendment, restricts the executive and/or judicial branches, is there a problem, but the First Amendment affects only the legislature; it does not affect even governmental officials not in the legislature, much less does it affect private citizens such as a high school valedictorian.
As an aside, I am frustrated to no end by those who cite the First Amendment's religious clauses in their defense (in order to restrict governmental involvement in religion) but who are otherwise do not oppose government involvement in general. I often say that religious freedom is merely a microcosm of libertarianism in general. If you study 16th-18th-century history, you see that much of libertarianism in general grew out of opposition to religious persecution in particular. After all, religion was the most important thing in the world, and if there was ever any opposition to government or tyranny, that opposition would first surface with religion. Whether a person was willing to change his religion to suit the government's, or whether he was adamant about worshiping in his own way; and whether he tried to use the government to force others to worship like himself, was always the first manifestation of whether a person was a statist or a libertarian. (The second manifestation was probably the right to bear arms; once a person decided to rebel against the government over religion, he needed weaponry in order to do so. "Rebellion to Tyrants is Obedience to God"!) So anyone who demands religious freedom but not libertarianism in general, is a hypocrite. In 18th-century America, there was already, for the most part, complete freedom of exercise. The state church of Massachusetts, for example, required people to pay taxes to support the church, but otherwise, everyone was free to worship as he wanted. Patrick Henry (the great Antifederalist!) wanted to imitate this in Virginia, with his "A Bill Establishing a Provision for Teachers of the Christian Religion", but Thomas Jefferson opposed it with his own (and victorious) Virginia Act For Establishing Religious Freedom. But as I said, there was already full freedom of exercise! So what did Jefferson oppose? Taxation. That is it: taxation. Taxation alone was the sole issue at stake. So how many people who cite Jefferson's famous letter to the Danbury Baptists (which relied on Roger Williams, hardly an atheist), also rely on Jefferson's argument that the primary issue of religion-and-government was taxation and taxation alone? Are these people who speak of "a wall of separation between Church & State", also voting for Ron Paul? Anyone who demands freedom of worship, without denouncing John Maynard Keynes as a despotic tyrant, is a hypocrite. Indeed, my own being a libertarian today, started with my opposition to the Israeli government's insistence that IDF soldiers had to obey orders to expel Jews from Gaza, which orders these soldiers felt violated the Torah. It was a short step from my opposing a government that insisted soldiers obey orders they considered to be contrary to their religion, to my today being a general libertarian, favoring Austrian Economics and all that jazz.