Isaac Newton laid out the physical ballistic requirements to hit the moon with a gun in his famous Cannonball thought experiment. Since Newton, and for years before him, humans have relentlessly sought to shoot the man in the moon in his big, smirking face. Now, we've nearly figured it out.
There are only two ways to get off this planet—powered and unpowered. Rockets, which use propellants to continually accelerate as they travel, fall into the first category. Space travel as we know it has been almost exclusively the powered kind. This is because it is much less stressful on both the craft and its payload while they reach escape velocity (the minimum speed and direction an object must travel so it doesn't fall back down or enter orbit around the planet).
Bullets, which only accelerate until they leave the muzzle of the gun, have a harder time escaping. Therefore, we're going to need a bigger gun. Much, much bigger. Bigger than any gun ever built before. That Nazi railroad gun from WWII? A pea shooter compared to the cannon necessary to put packages into space. We're going to need a Space Gun.
A space gun is a gun what launches objects into space. Duh. It's the unpowered alternative to rocket launches. Jules Verne made the space gun concept famous in his science fiction classic, From the Earth to the Moon. The US military has made several attempts to build them as well, first with high explosives, then with electromagnetic rail and coil technology.
The military's s first successful endeavor, SHARP (Super High Altitude Research Project), ignited pressurized methane to drive a 1-ton piston. This compressed hydrogen gas in the other end of the firing tube to 60,000 psi, launching an 11-pound projectile at Mach 8.8—that's 6,700 mph. Even more impressive was Project HARP. It shot a 400-pound slug 110 miles at 8,050 mph, using a 100-caliber (16-inch) naval gun.
But for as impressive as these feats are, neither HARP, nor SHARP, nor any other DoD ballistic space launch project has ever successfully put an item into orbit. So military interest in recent years has waned. Private enterprise has thus taken the space gun helm, with firms like Quicklaunch and StarTram vying for investors. Such a gun has immense construction costs, but the potential is also big—operating rates could be as low as $250 per kg, compared to the average rocket launch cost of $5000 per kg.
But there are a few fundamental problems with space guns that must first be overcome before this technology becomes feasible—the least of which is the fact that payloads are being shot out of a gigantic fucking cannon at supersonic speeds. See, unlike rockets, ballistic projectiles only accelerate until they exit the barrel. This means that in order to hit the minimum escape velocity necessary, payloads have to be moving incredibly quickly (did I mention, Mach 8.8) as they leave the muzzle, punch through the Earth's soupy atmosphere, and escape the planet's gravitational clutches.
To do this, we either need a gun with an unfeasibly long barrel or we need to fire the projectile with much more force—hundreds of Gs worth of force. Even if the barrel were 60 km long, the projectile would have to be accelerating at more than 1000 m/s2 as it leaves the gun in order to hit escape velocity. Such acceleration would impart over 100 Gs on the payload during the 10 second trip. The problem is, humans clock out at 25-35 G.
It's not only the payload that suffers, the projectile's exterior also endures extremes during launch. Since the projectile is moving fastest at the point where the atmosphere is thickest (presumably at sea level as it exits the muzzle) immense frictional heat is produced. As Greg Goebel of Vectors explains, "a simple calculation based on a 1-kilogram cubic projectile launched at a muzzle velocity of 39,600 KPH at sea level shows that it will lose 20% of its velocity and a good part of its ablative thermal protection in the first 16 meters of flight."
Even if the gun were situated on a mountain top above 15,000 feet, which reduces the amount of atmosphere to push through and cuts power requirements by a third, the energy needed for operation would still be prohibitively large. At least with our current level of technology.
When it comes to actual impact, luckily, the laws of gravitation make hitting another celestial body pretty easy. So long as a passive payload isn't travelling faster than the target's escape velocity when the two meet, the gravitational pull of the the moon will attract the the bullet enough to cause it to strike within its first orbit. Even with hitting the moon nearly guaranteed, though, it would be far more useful if we just could put the projectile into lunar orbit.
Getting into the moon's orbit is another job that requires a powered rocket. Orbital insertion has always been done with an active payload (one outfitted with retrorockets or aerobrakes) that can adjust the shape of its orbit after launch by reducing momentum to less than that of the target body's escape velocity. The Mars Recon Orbiter, Mariner 9, and every other spacecraft we've hucked through the solar system have all employed this technique. Which is great—if you want to almost get there.
So, do you still want to successfully shoot the moon? You just have to build a giant gun on top of a really tall mountain, load it with something that can withstand both the monumental force of launch and the supersonic impact with an interplanetary surface, and do it all for less than the cost of the Death Star. No problemo.