William Edward Hanford, 87, an industrial chemist who was an inventor in the 1930s of polyurethane, the material now put to such diverse uses as foam padding, upholstery, carpeting and artificial hearts, died of a heart attack Jan. 27 at the Fernwood nursing home in Bethesda. He had lived in Bethesda since 1970.

With Donald Holmes and other chemists at E.I. du Pont de Nemours & Co., Dr. Hanford discovered the basic broad chemistry of polyurethanes, opening a new field of industrial chemistry that led to synthetic foams, fibers and composite materials. More than 6 billion pounds of polyurethane is produced worldwide each year.

The early polyurethane patent, filed for in 1937, was issued to Dr. Hanford and Holmes in 1942 and assigned to the Du Pont company. According to a polymer text from 1962, a similar U.S. patent had been issued a year earlier to a German scientist who was working on a substitute for nylon, which Du Pont already had patented. The Hanford-Holmes patent was considered much broader in its application.

After World War II, work began in the United States and Britain on flexible foam polyurethane to replace foam rubber. The new polyurethanes proved more durable than rubber, which had to be vulcanized, and were used for new types of weather coatings, insulation and adhesives, according to Morton Litt, professor of polymer science at Case Western Reserve University.

Dr. Hanford left Du Pont in 1942 to do research at General Aniline and Film Corp., where, under his direction, the first liquid detergent suitable for home use was developed. He later was director of petroleum and chemical research at the M.K. Kellogg Co. and vice president of research and development at Olin Mathieson Chemical Co., where he resumed his work on polyurethane.

Over the years, he contributed to the technology of polyamides, polyesters, polymerization of ethylenes and fluorocarbons, high-pressure acetylene chemistry and color photography. He directed work to synthesize ammonia, which led to the enlargement of ammonia plants and decreased manufacturing costs, and oversaw work on flame retardance.

Dr. Hanford, who held 125 U.S. patents, mostly in polymer chemistry, retired in the mid-1970s as vice president and director of research of the Olin Corp. With his son, William Edward Hanford Jr., he began a company, World Water Resources Inc., that supplies developing countries with equipment for sanitizing drinking water with calcium hypochlorite.

Dr. Hanford, known as Butch, was a native of Bristol, Pa., and a graduate of the Philadelphia College of Pharmacy. He received a master's degree and a doctorate, both in chemistry, from the University of Illinois.

In 1991, Dr. Hanford was inducted into the National Inventors Hall of Fame for his polyurethane work. Holmes, who died in 1980, also was honored by the Akron, Ohio, organization, whose roster of inventors includes Thomas Edison and Henry Ford.

Dr. Hanford's honors also included the Chemical Industry Medal of the Society of Chemistry Industry, the Olin Research Award and the Pioneers Award and gold medal of the American Institute of Chemists.

He also was a ballroom dancer and, along with his wife, won three trophies from the International Ballroom Dancing Association.

He was president and chairman of the American Institute of Chemists; a member of the American Chemical Society, the Cosmos Club and St. Patrick's Episcopal Church in Washington; and a trustee of the Philadelphia College of Pharmacy and Alfred University.

In addition to his son, William, of Bethesda, survivors include his wife of 56 years, Lorraine Hanford of Bethesda, and two grandchildren. A daughter, Ruth Harwood, died in 1948. MARTHA H. FOSTER Volunteer Coordinator

Martha H. Foster, 80, a volunteer coordinator with the Hermitage of Northern Virginia for 17 years before retiring last year, died of cardiac arrest Jan. 22 at Fairfax Hospital.

Mrs. Foster, who lived in Springfield, was born in North Carolina and raised in Jacksonville, Fla. She attended a business college and then held several business management positions in the Florida lumber industry.

In 1973, she moved to the Northern Virginia area and was hired by Carr Inc. as a business manager. She later held a similar job with the Department of Housing and Urban Development, rotating between its Washington and Atlanta offices.

She was a member of Springfield United Methodist Church, United Methodist Women and the Circle of Friends and was a representative to the American Volunteers Association.

Her marriage to James W. Foster ended in divorce.

Survivors include a son, James Foster of Springfield; a daughter, Patricia DeRojas of Lithonia, Ga.; two brothers, Richard Hester of Springfield, Mo., and Kenneth Hester of Jacksonville, Fla.; three sisters, Anita Teipel of Macon, Ga., and Jannie May and Edna McNeill, both of Jacksonville, Fla.; five grandchildren; and four great-grandchildren. THERESA GALLOWAY Volunteer

Theresa Galloway, 47, a resident of Nokesville since the early 1980s where she had done volunteer work at schools and at Greenwich Presbyterian Church, died of cancer Jan. 26 at her home.

Mrs. Galloway, who was born in Refugio, Tex., married Joseph L. Galloway when she was 18. She accompanied him on his journalistic assignments to the Far East, India and the former Soviet Union before settling in Nokesville. In addition to her husband, survivors include two sons, Lee and Joshua, all of Nokesville, and seven brothers and sisters.