The longest-serving House speaker, Mr. Rayburn was considered a master legislator, one to whom Ms. Pelosi is often compared.