Anything you do to "fix" this behavior will feel artificial. I'd rather not encourage spreading out fire through the rules because I am finding it difficult to imagine rules to encourage that behavior which won't also make it feel more like a board game than an RPG.
I mean, the focus-fire behaviour
is board game behaviour. It's entirely artificial. Focus fire isn't a real thing in real person-level combat , because in actual combat, if you all try to kick one guy in, you get stabbed in the back and die. D&D 5E has no simulation of the latter, having abandoned flanking, firing into melee, and similar rules.
It's not even viable in most videogames except those distantly derived from D&D (like most MMORPGs).
Basically the issue is two-fold, and mostly about monster design:
1) Enemies gain no meaningful benefits in 5E when "left alone". In 3E, because you got AoO'd if you tried to cast or shoot ranged attacks whilst engaged, there was at least a reason to engage people and spread out melees (though ranged/casters still typically focus fire'd). Most enemies in 5E will do exactly the same thing whether someone is in their face or not - Ranged enemies often get Disadvantage but they tend to be pretty nasty in melee (sometimes truly unnecessarily so), or have ways to get away (if they're serious), so it's not a big deal.
2) D&D 5E is about giant "bag of HP" enemies, moreso than any other edition (yes including 4E). Even relatively low-end enemies can have high double-digit HP, and triple-digit HP come in surprisingly early.
It's worth noting 5E has the "focus fire" issue worse than any previous edition (including 4E), and I think most of that is down to "bag of HP" factors, but also players are just smarter tactically (not strategically, tactically) now than they were twenty years ago - I think this is largely down to videogames derived from D&D (all of which rely on "bag of HP", none of which really penalize enemies for being in melee) teaching them to play that way.
A lot of the "solutions" people are proposing are hilariously unrealistic, I note. This isn't a melee thing, and punishing melee characters further in 5E is incredibly silly. Focus-fire is from melee and ranged working together. If it's just melee there are tons of simple issues it creates, like enemies just dropping AOEs (esp. CC) on them. But in the actual game it's usually the ranged working with the melee - or only the ranged focus-firing because the melee are trying to tank (something no-one is all that great at in 5E, given the lack of Feats at low levels). Indeed, in the games I play in this is what we usually see - the melee split up a bit to try and tank and/or harass enemy ranged whilst the ranged just systematically kill everything.
Re: using it on the PCs, you absolutely can and it's extremely effective, but it feels like absolute crap for the player being subjected to it, esp. if you do it repeatedly, esp. if they're not a "tanky" PC. So that's a great way to make your game un-fun, but not a real solution. It was a legit tactic in 4E where there were counters and other issues, but there aren't many counters in 5E (and the few that there are for casters only), so if you have a fair few ranged and just have them "focus down" the PCs it's probably going to work great. Hope you enjoy murder-eyes from your players and them probably stopping coming to your sessions if you keep doing it repeatedly (DMs have a massive advantage here in that they can freely plan encounters and if their monsters get killed, well, that's what's supposed to happen).