Humans are very good at making guns. In theory we can make a gun big enough to fire at another planet.
We don't know how much time we have before the Martians invade. We could make a gun and fire a large explosive at Mars within a few months. But what if we just anger them and they fire back?
Or we could take longer and make a bigger gun, and send people to Mars. But that's a huge risk, a hundred things could go wrong!
Or we could take even longer and develop a proper space program. But can we afford the time?
Or should we do something else?