Did just a tad of research about Speaker of the House. Turns out the office isn't merely a political plum but is ordained by the Constitution (Article I, Section 2, as per the Wikipedia).
Someone has to fill that office lest all sorts of chaos ensue, as all sorts of chaos is now ensuing.
The Speaker doesn't have to be of the majority party in the House, though, over the course of history, has usually been.
Doesn't even have to devolve on any one seated in the House. Could be me, could be you, could even, as some have suggested, be Mitt Romney.
Anyone, I gather, upon whom the House decides.
Of course that someone is next in line, should catastrophe befall President and Vice-President, for highest office. . .
I doubt the Founders ever contemplated such a bug in their program.