There are many legal tactics for defending a jump shot. You can take away space from the defender and impede their landing in a very crafty way. You can push the bottom of their elbow a bit and hope the referee doesn't see it. You can put your hand in their face and hope to shield their view of the rim.
When there is a shooter in the corner, you'll often see the opposing bench (and sometimes the coaching staff) yell at the shooter in an attempt to distract him. If you can break his concentration then maybe you can affect the shot and help keep it from going in. One tactic that is frowned upon is actually throwing something at the shooter to distract him. Tony Allen accidentally did this during the third quarter of Game 5 between the Memphis Grizzlies and Oklahoma City Thunder.
As Derek Fisher was shooting from the right corner near the Grizzlies' bench, Tony Allen tried to distract him by moving his hands and yelling. Unfortunately, he had a shirt inside the towel in his hand and lost his grip on the shirt. It flew onto the court and he was whistled a technical foul from the bench. It clearly wasn't something he planned on doing and he regretted it immediately. But that didn't stop the Thunder from using it as a catalyst to make a run to get back into the game.