Well, normally a bailout doesn't involve just giving people money (the bank bailout was a loan), but you could do that, it'd be a massive cost however. The biggest winners would also be those with terrible loans/those who issued them.
Alternatively, you could just give all homeowners a loan instead - but this doesn't change the fundamental issue of subprime mortgages, so it would really just be pumping up the bubble further.