A Hail Mary pass or Hail Mary route is a very long forward pass in American football, made in desperation with only a small chance of success, especially at or near the end of a half.
The expression goes back at least to the 1930s, being used publicly in that decade by two former members of Notre Dame's Four Horsemen, Elmer Layden and Jim Crowley. Originally meaning any sort of desperation play, a "Hail Mary" gradually came to denote a long, low-probability pass attempted at the end of a half when a team is too far from the end zone to execute a more conventional play. For more than forty years use of the term was largely confined to Notre Dame and other Catholic universities.[1]
I know this is Wikipedia, but it's also the first easily searchable Google result. You snap the ball, receivers run as far afield as they can, and you heave the ball in desperation and hope someone comes up with it. You could run a hook and ladder or any other run/lateral based trick play and try the same thing no matter the distance.
Also from the same article: "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."
An 18-yard pass against a prevent defense is low probability, but by no means a 'prayer' (as in, 'hail mary.') Believing something firmly doesn't make it right.