President Reagan yesterday ended a lucrative practice by Washington lawyers who long have earned big fees by dashing to distant cities to find sympathetic federal appeals court judges to hear their challenges to unwanted orders issued by federal agencies.

The practice has been called a "race to the courthouse" because lawyers for various sides in the agency disputes often have sped to various appeals courts each seeking to be the first in a courthouse and thus decide where the case will be heard.

That will end under legislation signed into law yesterday. Under the law, a new judicial panel will randomly select a circuit court to hear appeals from agency decisions in cases where more than one appeal has been filed.

The president also signed legislation making "a number of significant technical and clarifying changes and improvements" in federal retirement programs. "While not perfect, these changes will improve the operation of the government's retirement system for its employees," the president said.

Reagan voiced strong objections to provisions added to the bill by Sen. Ted Stevens (R-Alaska) that would "effectively erect barriers to air carriers that want to provide mail transporation service to rural areas in Alaska and, in some cases, may well discriminate against existing air carriers." The president said he would have vetoed the provision if it had been given to him as a separate measure. He urged Congress to repeal the provision "at the earliest opportunity."

In another action, the president named two women to be special assistants for public liaison, positions that were high-profile appointments early in his presidency when he was attempting to mobilize public support for many legislative initiatives.

The appointees are Mary McGeein Schnepper of Arlington, who has been an associate director of business liaison, and Juanita Donaghey Duggan of Washington, who has been assistant director for legislative affairs at ACTION. Duggan, an aide to former senator Jeremiah Denton (R-Ala.), will work on domestic policy issues. And Schnepper will work with commerce and professional associations, the White House said.