From experience with my good ol retaliation S&B warder, I can suggest getting an item with a “% chance when hit” skill like a lightning bolt or orb or somesuch, or a weapon like a dawnbreaker’s sledge that will cast the skill on autoattack and it sometimes will land on the ranged enemies. Stacking aoe shockwaves or novas when hit and trying to stand close to the rangers also works most of the time.
But if you’re up against a ranged or spellcaster boss, your best bet is pointing at them, weighting down your autoattack key and go make some coffee or something. Shit’s gonna take a while.