This topic is something that comes up often when players are deciding what character they want to play. Some DMs will require that their party have some sort of balance or follow the basic "holy trinity" (tank/healer/DPS)
Personally, I would rather have my players play whatever class/race/kind of character they want. I find that when players are forced into a role like tanking or healing that they don't really want to do, they end up not having fun and quitting...
As the DM, there are multiple ways to adjust for a party that is missing a piece or is not balanced.
You can design encounters based around the lack of a certain archetype. This is easier for some things that might be missing and a bit harder for others. For instance, the lack of a rogue or any character with thievery skills can be compensated for by giving traps and locked doors a solution that doesn't require thievery. Perhaps you use traps that can be disarmed through the use of the arcana skill, as well as thievery. Perhaps the players can break down the locked door (not exactly stealthy, perhaps they have to fight a group of guards that respond to the noise)
Designing around not having a healer or tank is more difficult but still quite possible.
For a healer, perhaps you make things like healing potions and "charged" items of healing more plentiful. Perhaps the group gets items like a wand or belt "of healing" with so many charges, or perhaps they receive plenty of healing potions...
The other design option for not having a healer is to make the game feel more "real" in the sense that getting into a fight is a dangerous thing and doesn't happen as often.
Working around the lack of a tank can be difficult as well, and I honestly haven't found a solid way to deal with this from an encounter design perspective aside from just making the encounters easier...
2.) Running a Dungeon Master Player Character (DMPC)
This is a pretty hefty subject. While this can be used to help balance the party, it can also be a slippery slope to a really bad gaming experience for everyone.
The biggest downfall or temptation here is to make your DMPC the star of the show and to make them more powerful than the other characters are. This is a terrible thing. Your players should be the stars of this show and they should be the ones driving the action. Your job as DM is to make the world unfold before them and let them tell a story in that world, not to just tell a story to the players where the DM is just talking to himself.
Some DMs run a PC in every group they run, others will never run a PC or even play in a group where the DM is running one.
So while this can be a solution, I recommend you use it with caution and sparingly.
3.) Putting an NPC (or a string of them) into the party to fill the gap
This is, in my opinion, the best option presented. You can fill party gaps fairly easily using an NPC, and it's a much better solution than using an running an actual character as the DM.
There are a couple of ways to make sure that the players won't lose the spotlight or use the NPC you give them as a crutch.
For example, perhaps in a party with no healer, the king sending them out to do his bidding offers a healer from his court to go along. This healer is part of an ancient sect that takes a solemn vow of silence and pacifism, going so far as to not even defend himself if attacked. Perhaps he gives them a healer who is great when it comes to healing, but is an enormous wuss. He will always recommend the course of action that shows the least risk if asked, and will try to avoid fighting at all costs.
For a tank type character, think perhaps a character like Ser Ilyn Payne from the "A Song of Ice and Fire" series. Great with weapons, but had his tongue cut out and can no longer speak or perhaps a half-orc who doesn't have the ability to speak beyond a few words but can understand what's being said. Another option here would be a character similar to Chewbacca - he can understand everything but speaks a different language that can only be understood by one (or none) of the party members.
These are some of the options you can take when trying to fix a party that is not balanced.
PS - currently reading Robert Jordan's "Wheel of Time" Series - if you haven't checked it out yet - pick it up! It's an excellent series and completely worth the read!!