Ed’s got the real stuff. As with any other muscle in your body, endurance is a built thing, so while the strain could be attributed to a mildly flawed technique, at the same time you may just need to build endurance slow and steady. As with everything else in guitar, play as relaxed as possible, with minimal tension. Once you’ve ruled out any possible errors in technique, and if you still get the tension pain after that, keep playing through the pain (but don’t injure yourself of course), and simply build the endurance. After a while, you’ll probably find you can go longer and longer before it becomes painful, and at one point the pain may simply disappear and you’ll be set.