I once had a Shadowrun group who hit a truck transporting gold, and they walked away with something like two million nuyen (each) in a campaign where that was more than they had combined through character creation and their careers.
It was somewhat of a mess, but it counteracted itself nicely, because I didn't just let them spend it on anything they could afford-they had to justify finding, and purchasing their new gear, so instead of immediately buying weapon and power foci and cutting-edge augmentations and weapons the massive haul wound up sending them on missions to build relationships and find things that they could then spend their money on; in addition to the copious amount spent on outfitting the team with headquarters and new shiny vehicles so they no longer had to take the bus or drive personal vehicles around on their runs.
Basically, look at the windfall as a stepping stone to future encounters; players probably don't have the relationship with the master artificers or merchants who sell the sort of things they can now afford to buy some of the stuff they want, so they'll have to work to it.
Of course, though this doesn't work in every setting, spending a lot of money at one time tends to be frowned upon in certain places, especially when tax evasion or criminal acquisition is suspected.
There's a two step process needed here.
- Say to your players what you just said to us
- Then mind your own business
Have they not noticed that imbalanced loot is throwing off their party balance? Or is it that they don't care? If they do not care and are having fun, it is not a problem. If they haven't noticed, then just telling them "Hey gear is important to power in Pathfinder and have you noticed that the way y'all are going about it is keeping some characters really loot poor?" should be sufficient.
For some groups, loot distribution is not some game rule thing where you must ensure adherence to "wealth by level," it's a roleplaying exercise because it's an in character activity. If they're a bunch of CN Vikings then "first with your hands on it gets it" is a perfectly viable treasure distribution practice.
I disagree with most of the other answers here that there's some burden on you to go stick customized magic into the poorer PCs' pockets until they are matched up. There's nothing wrong with personalized rewards (with in game justification) but a) that doesn't scale to someone's whole gear loadout and b) it's not healthy to do that when they are deliberately unbalancing the gear anyway - they end up getting way too much gear if you are pouring in more gear to make up for a minority of the group getting most of it.
I've been in groups where the party decides to distribute loot in a wide variety of ways - and it's not always constant in a group, it's what makes sense to the characters. In my first pirate game, for example, there was a complex ruling on who got to pick items from the loot in what order based on job title on the ship encoded into the crew's Articles. "Our raid got 10 items? Well the choice order is captain, first mate, quartermaster, master gunner, carpenter..." In my newest pirate game, there's a quartermaster who instead doles out virtual shares to all crewmates in cash and they have to "buy" specific items which are otherwise liquidated. I mentioned to them that this has a downside - if I give them high power/high gp value magic items they are inevitably liquidated for gold instead of being used for their intended purpose - but they don't care, and in the end character activities (including loot distribution) are the players' business, not the GM's.
In one campaign of ours, one player wasn't bothering to gear his caster character up well at all and the other characters sat him down had an in-character talk with him. "Dude, you're starting to not be able to affect our enemies, do you need some money for some magic or something?" In the games where groups hand out magic according to their need, it's always an in-character discussion. Because differential power levels are not a player/metagame issue, they're a character/in-game issue.
But what about encounter design being hard because of a mixed-gear-power group? It only makes designing encounters hard for you because you're inappropriately trying to compensate for player behavior. Design your encounters, and if they are too hard for the people with bad gear and they get beat up while the people with good gear skate through, it will encourage them to address the gear disparity in the interests of "everyone being able to pull their weight." You're not their mom, you don't need to "serve balance" - you are attempting to control something that's hard and frankly undesirable to control and that's what's frustrating you. Stop, and let the burden lift from your shoulders. It's not your job to compensate for every decision, good and bad, your special little snowflakes make.
Best Answer
Chapter 7 of the Dungeon Master Guide has a nice set of tables regarding loot. I recommend giving them a chance. After having used them for a few session you will get to know how well they fit your DM style, and you'll be able to adjust the loot up or down as you feel appropriate.
A nice feature of the tables is that they take into account challenge rating and distinguish between individual loot and hoards. So you can use the first for most encounters and the later for when they have completed a mission or taken down the boss.