As noted in the coments, the presiding officer of the House of Representatives (or of a committee) has the responsibility to recognize members and keep order. The detailed rule are found in http://clerk.house.gov/legislative/house-rules.pdf.
To wit:
Decorum
1. (a) A Member, Delegate, or Resident Commissioner who desires to speak or deliver a matter to the House shall rise and respectfully
address the Speaker and, on being recognized, may address the House
from any place on the floor. When invited by the Chair, a Member,
Delegate, or Resident Commissioner may speak from the Clerk’s desk.
(b) Remarks in debate (which may include references to the Senate or
its Members) shall be confined to the question under debate, avoiding
personality.
Recognition
2. When two or more Members, Delegates, or the Resident Commissioner rise at once, the Speaker shall name the Member, Delegate, or Resident
Commissioner who is first to speak. A Member, Delegate, or Resident
Commissioner may not occupy more than one hour in debate on a question
in the House or in the Committee of the Whole House on the state of
the Union except as otherwise provided in this rule. Managing debate
3. (a) The Member, Delegate, or Resident Commissioner who calls up a measure may open and close debate thereon. When general debate extends
beyond one day, that Member, Delegate, or Resident Commissioner shall
be entitled to one hour to close without regard to the time used in
opening. (b) Except as provided in paragraph (a), a Member, Delegate,
or Resident Commissioner may not speak more than once to the same
question without leave of the House. (c) A manager of a measure who
opposes an amendment thereto is entitled to close controlled debate
thereon.
For the Senate, it is much the same:
- (a) When a Senator desires to speak, he shall rise and address the Presiding Officer, and shall not proceed until he is recognized, and
the Presiding Officer shall recognize the Senator who shall first
address him. No Senator shall interrupt another Senator in debate
without his consent, and to obtain such consent he shall first address
the Presiding Officer, and no Senator shall speak more than twice upon
any one question in debate on the same legislative day without leave
of the Senate, which shall be determined without debate.
http://www.rules.senate.gov/public/index.cfm?p=RuleXIX
In reality, I'm sure the details can get ugly.... But I do like the orderliness of the written procedures.
Speaker pro tempora
in the House? - if you read the congressional record (e.g. gpo.gov/fdsys/pkg/CREC-2014-02-05/pdf/CREC-2014-02-05.pdf) the preceding decisions are often attributed to theSpeaker pro tempora
[... in the linked issue, the Speaker Pro tempore is noted as Mr Ribble, who was not the Speaker at the time ].