Pakistani Prime Minister Yousaf Raza Gilani has been targeted by an assassin who fired shots at his motorcade.