Believe it or not, Bruce Willis had sort of the right idea in Armageddon: the most effective way to nuke an asteroid that's threatening Earth is to detonate the weapon deep inside the rock as opposed to on the surface. There may be a Willis/Affleck-free way to make this happen, by using an artificial asteroid of our own.
Moving an asteroid out of an Earth-intersecting orbit (or blowing it into harmless chunks) takes a substantial amount of energy. If we have the time, we can deliver this energy in lots of little bits, but if we discover a potentially dangerous asteroid that's likely to give us a smack in under a decade, our best option might be to deliver as much energy as possible as rapidly as possible, and that means nuking it.
Now, if you're going to nuke something with the goal of completely obliterating it, you want to first bury your nuke inside your target to some extent. This way, as much energy from the nuke as possible is transferred to the target instead of being wasted. If we're talking about asteroids specifically, you can imagine how a surface detonation would waste half of its energy out into space, but detonating even a little bit underground (say, ten feet or so) can enhance the effectiveness of your nuke by a factor of twenty.
On Earth, it's fairly straightforward to build nukes that are designed to penetrate into the ground before exploding, but things are different out in space because everything is moving much faster relative to everything else. A hardened penetrator can survive impact velocities of about 700 mph, but anything beyond that will just obliterate its electronics. Running a nuke into an asteroid, however, is likely to occur at impact velocities of something like 70,000 mile per hour, and nothing is going to survive that.
So, here's the idea that NASA is playing with: a two-part spacecraft. The front part is a penetrator, while the back part carries the nuke. It can be constructed and launched quickly, and since it doesn't need to enter orbit around the target asteroid, it can travel fast. Once the spacecraft gets close (about 24 hours out), the penetrator separates from the nuke, and accelerates slightly. Over the remaining distance to the target, the penetrator gets out ahead a little bit, until it impacts before the nuke. This impact carves out a small crater, which the nuke carrier flies into and then detonates, effectively getting below ground level. Clever.
This concept comes from Bong Wie at Iowa State University, and NASA has funded further study towards "a near-term demo mission architecture for flight-validating planetary defense technologies" to the tune of $100,000.