The traditional narrative summary of American air-to-air combat in the 1960s and 1970s goes a little like this:
Believing a new age of pushbutton warfare had dawned, the Americans designed their new fighter without a gun! This technological hubris resulted in American combat aviators being unprepared to face a brave, hardy foe flying “obsolete” cannon armed Russian fighters. After suffering terrible losses, and finally learning their lesson and some humility, the Americans relented and put the gun back on their fighters, and finally won the air war.
Like most common knowledge distillations, the facts of this story are generally correct, but the interpretation of them is not, and can lead historians and other people trying to glean lessons from the past to incorrect conclusions. So I come here today to defend the honor of the F-4 Phantom, and its engineers and designers, who I think knew a thing or two about what they were doing and shouldn’t bear the blame for (two!) intellectually clumsy institutions learning a new way of fighting on the job.

USAF F-4D Phantom II.
To begin, we have to go back to 1945 and the close of the Second World War. The problem faced by the Allied air forces had changed in scope and magnitude. The Axis powers never fielded large, multi-engined strategic bombers in any numbers, but the new era of atomic warfare meant two things: Future enemies would be flying big bombers to carry one big bomb, and no enemy bombers could be allowed to penetrate the defensive perimeter. One or two 1944 bombers getting through wouldn’t be a disaster, but a single 1946 bomber evading interception would mean the loss of a city.

The Soviet Tu-4, a to the rivets reverse-engineered copy of the B-29
Atomic-capable bombers were big, durable aircraft with multiply redundant propulsion and control systems that were difficult to destroy with the .50 BMG machine guns (with solid, non-explosive bullets) that were the main armament of interceptors and fighters. Early 20mm cannon with HE shells jammed a lot and were slow firing. The revolutionary 6000rpm 20mm M61 Vulcan wouldn’t be ready until the next decade, and even then an interceptor would have to close to bad-breath distance to engage and could only handle one bomber per pass.

M39 20mm Autocannon.

M61 “Vulcan” 20mm rotary autocannon.
Nazi Germany, having had to contend with waves upon waves of heavy, hard to kill, multi-engined bombers for years, pointed the way. Rockets could carry a bigger warhead than any cannon an aircraft could be expected to manage, and offered significantly better speed and range. Early attempts were unguided salvo fired rockets, but work had begun on guided rockets like the air-to-air Ruhrstahl X-4 and other surface-to-air designs. Early attempts were manually wire guided and limited by the fragility of the wire spools and the target being within visual range. But the possibility of a one hit kill was tantalizing.
America has two air forces, with two slightly different target sets, so two slightly different approaches were taken.
Our Army’s Air Force (newly independent in 1947) was mostly concerned with knocking down the bombers before weapons separation, so their missiles reflected that.

Hughes AIM-4 Falcon
The Hughes Falcon was a slow flying, lag pursuit missile that relied heavily on lift over pure rocket thrust. The warhead was small and contact fuzed, as it was expected to have to a) fly through seductive decoys and b) physically hit and detonate inside the bomber to guarantee a kill.
The Falcon was a disaster in combat, especially against small, agile, maneuvering targets that its engineers did not expect it to engage.
By the beginning of June, we all hated the new AIM-4 Falcon missiles. I loathed the damned useless things. I wanted my Sidewinders back. In two missions I had fired seven or eight of the bloody things and not one guided. They were worse than I had anticipated. Sometimes they refused to launch; sometimes they just cruised off into the blue without guiding. In the thick of an engagement with my head twisting and turning, trying to keep track of friend and foe, I’d forget which of the four I had (already) selected and couldn’t tell which of the remaining was perking and which head was already expiring on its launch rail. Twice upon returning to base I had the tech rep go over the switchology and firing sequences. We never discovered I was doing anything wrong. — Col. Robin Olds (2010)
The Falcon also had short range, which was largely dictated by the small, unreliable radar sets the Air Force could cram into the noses of its fighters, which also had to share space with guns. Those guns that got hot, vibrated hard and generally shook to death the vacuum tubes and connections of early radars.
Our Navy’s Air Force had two things on its mind. First, the bombers themselves. For this the Navy was designing Sparrow, which began life as three designs: A beam rider that would go wherever the nose of the launching aircraft pointed, an active-homer with it’s own radar set (Sparrow’s narrow body limited the size of the radar and thus it’s range, and this variant went nowhere), and a semi-active homer that used the launching aircraft’s radar instead of its own, and only had to carry a receiver antenna. This was the winner, and it carried a good sized proximity fuzed warhead and had the range to engage enemy bombers at arm’s length.
Unfortunately, a big ranged missile meant a big radar set to tell it where to go, and while transistors helped with the size of the computers and heat dissipation, engineers were still restrained by Maxwell and a big dish behind a big nose was required. There was no room for a gun in the nose, and it’s heat and severe vibration would have compromised the size and thus power and reach of the radar, which, take notes because this is important: which had become the primary weapon.
But the Navy had another threat looming large in its institutional memory, that of small bombs guided by humans: the Kamikaze. And Germany had again shown the future…

V-1 cruise missile.
…the robot kamikaze. Not only would the bombers have to be prevented from reaching the carrier group, and would have to be engaged further away than the range of their atomic-capable robot kamikazes, but if that failed, then the missiles themselves would have to be engaged with missiles.
Fortunately as often happens, we had the right people on the job at the right time, and a team of veritable geniuses at China Lake had pieced together a nose-steered, proportional pursuit (the missile flew to where the target was going to be, not simply follow it and out-accelerate the target) heat-seeker from basically off the shelf parts. Sidewinder was a brilliantly simple and effective design and went on to change air combat for both Air Forces, and the enemy as well.
Both Sparrow and Sidewinder deployed from the F-4 Phantom were (generally) what our Air Forces flew into combat with in Vietnam and accounted for the majority of American air-to-air victories. Early on, not much success was enjoyed. Inadequate battlefield radar surveillance and restrictive rules of engagement meant our spear chuckers had to close to within knife fighting distance. Missiles frequently failed to launch or zoomed away into the distance. Inadequate and improper maintenance resulted from ground crews treating missiles as ordnance, not fragile miniature aircraft that also needed to be maintained and preflighted. Overeager pilots were driving their missile armed fighters like gun-armed fighters and aggressively within the minimum engagement distance and the helpless missiles flew straight past their targets. Sharp turning MiG-17 and -19s were luring Phantoms into angle fights they couldn’t win, instead of relying on their massive engine power to decline unfavorable engagements.
In the four year lull between the battles of 1968 and the renewed air campaign of 1972-3, stock was taken and lessons learned. Arrogant hotheads like Steve Ritchie and Duke Cunningham taught new tactics and mindset to the new pilots and backseaters, and dictated improved ground handling to the support crews. Pilots learned to maneuver the target aircraft into the missile engagement basket, instead of putting their nose on the target. Missiles were fired in salvo pairs instead of one at a time. When the Linebacker air operations kicked off in 1972, two entirely new Air Forces went to battle, with reliable missiles and aircrews who had the patience to fly the Phantom with missile tactics in mind over gun tactics. Even after the cannon-bearing F-4E was available, only a handful of gun kills were recorded. The vast majority of victories were with Sparrow and Sidewinder. In fact, no gun kills were recorded a generation later in the skies over Iraq.
The biggest problem with the traditional narrative as above is this: Both the USAF and the US Navy flew into Vietnam with exactly the right aircraft and the right missiles they needed to dominate the skies, even though both organizations had made institutional and equipment decisions to deal with a completely different set of threats. The aircraft and missiles that won the skies in 1972 were almost the same as the ones that were nearly beaten in 1968. The only thing missing was the right doctrine, discipline and tactics to use the weapons in the optimal fashion. Big, lethargic, sclerotic organizations only learn their lessons when written in blood, and the loss of our pilots in 1968 paved the way for 1972, and 1991, and the resulting dominance America has enjoyed in the air since.
The gun (or lack thereof) had nothing to do with it.

So there.