If the cue ball is shot and is resting on the rail, it is considered not in play.
According to the United States Professional Pool Players Association Rule 3.b, this occurrence would result in a break foul.
Break fouls include the following:
b. If the cue ball is pocketed or driven off the table it is a foul and the non-breaking >player has cue ball in hand behind the head string (from the “kitchen.”)
According to the World Pool Billiard Association, this occurrence is also a foul under rule 6.1 sub rule 8.5
6.1 Cue Ball Scratch or off the Table
If the cue ball is pocketed or driven off the table, the shot is a
foul. See 8.3 Ball Pocketed and 8.5 Driven off the Table.
8.5 Driven off the Table
A ball is considered driven off the table if it comes to rest other
than on the playing surface but is not pocketed. A ball is also
considered driven off the table if it would have been driven off the
table except for striking an object such as a light fixture, piece of
chalk or a player which causes it to return to the table. A ball that
contacts the top of the rail is not considered to have been driven off
the table if it returns to the playing surface or enters a pocket.