John McCain raised almost as much money as Barack Obama in May, placing him virtually on the same financial footing as his Democratic rival.