The rate of fire of the common musket was not very high. The accuracy of the common musket (especially among troops who did not spend a lot of time practicing marksmanship because of the expense of ball and powder) was not very high, either. The actual method of battle up until that century was rather similar to the methods of the Roman infantry, upgraded from spears to muskets.
Thus: Hurl spears at the enemy line, hoping to hit some and disable the shields of others by having the soft-pointed spear embed itself in the shield and make the shield too unwieldy to use in combat. Repeat with two more spears, then take out the sword and go face the enemy man-to-man.
Then: Fire a round in the general direction of the enemy, hoping to hit some and demoralize others, repeat with another two or three rounds while advancing on the line. Then advance with your bayonet (or, if you were in the second line and not carrying a musket, your pike) and go face the enemy man-to-man.
Most of the fighting was done with the pointed and edged weapons, with the firearms being used only as a method to break up the line.
It was not as dangerous as it would seem. (It was not safe, of course.) However, consider the 1777 battle of Saratoga. At one point, the two sides faced each other across a clearing that was little more than three acres and fired on each other continuously for almost three hours. They each suffered “horrifying” losses–that amounted to less than 10% of either force. The fire was fierce enough to prevent either side from making the bayonet charge that could have decided the issue, but they could not hit each other well enough to actually eliminate the opposition.
Note that the sharpshooting that went on after the battle of Concord was actually an anomaly for successful battles. (Even in that battle, whenever the colonials would gather several men in a sheltered position to fire on the retreating British, the Brits generally detached a squad to rout them out–and they were always routed out.)
Major battles were decided by putting the most men in the face of the enemy and overwhelming them in hand-to-hand combat. The Pennsylvania long rifle that was so much more accurate than the musket, took most men 7 times as much time to load and shoot. For every round that a man fired, the attacking enemy could cover a third to a half of the range of the weapon. If you only get two shots before you are chewing on a bayonet, you’ll be pretty lucky to avoid eating steel.
I do not recommend that method of combat and I share your views that I would prefer a “better” way to fight, but those tactics were dveloped to make use of the equipment at hand, and they were very successful until the equipment improved.