A long shot

A bet or other risk taken though not likely to succeed.

It was a long shot that my friend would get the job so he was very happy when he did get it.