Character ratios, representation varieties and random generation of finite groups of Lie type