1) LOS is the first counter.
2) Another counter I use a lot is a stun, which brings them out of their turret stance. When it wears off (or they break it), they often forget to recrouch, which leaves them open to being pushed, thrown, and interrupted.
3) As a cloaked char, you can also cloak out of battle, and knock them out of cover too, which gives you a third counter. and leaves them open to the attacks in 2)
4) Finally, the last one is the simplest to counter them, keep running in circles around behind them. Yes, they can still attack you with some attacks, but not all, so the player will likely be swiveling his mouse around to try and face you which will make it more difficult for him to manage his abilities.
As a shadow (force techniques teir), here's how I take on a sniper:
1) if I can sneak up cloaked, I whirlwind him to knock him off balance. Use force breach and backstab him until I build a charge of instant use force crush.
2) I use force potency and then force crush, rock throw, and project combo.
- by this time, he's up again, probably crouched and about to snipe me or he's stunned me (I break stun) and shield up. I will then force stun him if I can, force breach, and backstab (then mind crush if instant hit has built up)
-before stun wears off, I will push him, cloak out of battle (with the increased cloak), and then do combo 1). Then combo 2) again if it's ready. If not, then I'll alternate with breach and melee attack until instant force crush builds up.
3) and when he's close enough, I switch to force breach and the critical hit until the instant force crush builds up and I can do 2).
However, if he's running around, it's harder to do all this, so I use force slow, speed, and the other two force attacks that come with my tier to attack from a distance and keep close when I can.
If I can get two uses of combo 1 and combo 2 each, plus using instant force crush a few times, I can usually bring a sniper down before I get below half health. Ops and scoundrel are a different story altogether though. I still have trouble managing them.. :P
I'll tell you what not to do. If you have to cast whirlwind 9as in not instant); probably better not do it right in front of the sniper one on one.
Had a sorcerer do this the other day as I was solo guarding a node. I hit entrench when they were almost done, and had called incoming before they even got in range. I kind of paused to laugh as I saw them just procede to the node and start trying to cap, oblivious to the fact that I was not in a whirlwind. Then I shot them, and they turned and tried to hit me with their stun while entrench was still up. LMAO