If the bike is a modern bike, check the outsides of the lever for a small groove into which an allen wrench can slide. The groove will quickly disappear under the rubber of the hood. Tightening or loosening the nut at the end of that groove will tighten or loosen the clamp that secures it to the handlebars. Loosening it will allow you to pivot the hood back to straight.
If the bike is an older bike, the clamp nut is probably inside the lever hood. These can be a pain in the butt, as some of the old clamps used a flathead screw directly behind the brake cable. To loosen the screw without completely removing the cable, look for a tension release on the cable or brake calipers by the wheel. That will allow you to slide the screwdriver past the brake cable inside the lever a bit easier, but it's still a pain without removing the cable entirely.
In either case, remember to re-tighten the brake lever in place.