Lateral raises are a common exercise, designed to enhance shoulder strength.
When comparing side lateral raises - frontal plane - to 30 degrees lateral raises - scapular plane -, it appears that the latter is more natural and allows to avoid impingement.
Adding a little bit of shoulder external rotation also seems to help with avoiding tendon irritation.
Regarding a variation exercise, with bent elbows, the interesting thing is that you can theoretically double the weight lifted. Because of the different lever, it will require the same amount of strength when compared to extended elbows.
With bent elbows, shoulder external rotation and back extension are the most frequent compensation patterns It usually happens when working with too heavy weights.
So basically, when performing lateral raises, do it in the scapular plane, try to keep a neutral spine, and add some shoulder external rotation if it hurts.