I'm designing an encounter with a magma elemental at the bottom of a mine ending in a volcanic area. There is thick lava everywhere,with areas of small rock islands. It will take the party a few moves to get to the elemental and I thought surely it could have a range weapon of throwing gobs of thick lava at them as it moves towards them. I'd guess 2d6 damage on a hit with the 1d6 afterwards for a round or two.
Magma elementals already have the Lava Puddle ability:
Lava Puddle (Su)
Once per day as a full-round action, a magma elemental can vomit forth a puddle of lava that fills its space to a depth of 2–3 inches and counts as difficult terrain. Any creature that moves through this puddle of lava takes 2d6 points of fire damage. This damage continues for 1d3 rounds after the creature leaves the lava pool, although then it only inflicts 1d6 points of fire damage per round. The lava puddle solidifies and is safe to touch after a number of rounds equal to the elemental’s Hit Dice. At the GM’s discretion, this puddle of lava could start secondary fires.
You can make it ranged by simply including a ranged attack as part of the action. Hitting a square is equivalent to hitting AC 10. Give the ranged attack 10ft range increments so that it's not trivial to hit the square at high distances. Since you'd be targeting the squares rather than a character, I would give those in the square the ability to roll a Reflex save to halve the initial 2d6 damage and negate further damage (the saving throw wouldn't apply if the characters willingly step into a square already affected). The DC would be Constitution-based (10 + 1/2HD + Con).