Setup
There is no one setup, although many teams may have a "Hail Mary" type play in their playbooks. More often such plays are called a "post" or a "fly," although most plays in football playbooks have numerical tags as opposed to names. Generally there is no standard "Hail Mary Play."
A play is more often called "Hail Mary" after the fact, that is if and after it has worked out against all odds and resulted in a score in the final moments. It is more a descriptive term of a sports moment, as opposed to a planned play.
Although such plays have low percentage chance of completion, there is likely some type of long pass play in every playbook at the professional and college level. Such a "long ball" "post" pass can occur with four or five wide receivers in the singleback formation or with four or five wide receivers in the standard or shotgun formation. Generally, three or more eligible receivers are lined up on the short side of the field and all run a fly pattern. The running backs, if in the play, may be kept in to block. Sometimes the team running a post will not even have a running back in the backfield, instead choosing to use every possible eligible receiver (five of them) to run a pass route, hoping to spread out the defense and give the quarterback more passing options. The quarterback throws towards a receiver, making the decision as to which one within 2 - 2.5 seconds of getting the snap. The Hail Mary pass does not always need to be completed to move the ball for the offense. It may succeed in drawing a pass interference penalty on the defense (a strong possibility with so many receivers running deep routes for the defense to cover), which gives the offense the ability to run another play with better field position in all situations (since the game cannot end on a defensive penalty, even if there is no time left on the clock). In college it may not help much as pass interference is only a spot foul up to 15 yards, while in the NFL, it is a spot foul no matter where it occurs, with the ball placed at the 1 yard line if the infraction occurs in the end zone.
Read more about this topic: Hail Mary Pass