Mr. Foreman became James Earl Ray's lawyer 36 hours before he was scheduled to go on trial for the killing of the civil rights leader. Mr. Ray had dismissed his attorney Arthur J. Hanes after conferring with Mr. Foreman for several hours. Mr. Foreman eventually persuaded Mr. Ray to plead guilty to the 1968 slaying in exchange for a 99-year sentence.

Mr. Ray, who maintained that his only role in the assassination was to buy the murder weapon and give it to a man named ''Raoul,'' later said Mr. Foreman had pressured him into pleading guilty by saying he was 99 percent certain Mr. Ray would go to the electric chair if he faced a jury in Tennessee.

Until he took the Ray case, Mr. Foreman was most famous for a case he did not handle at all. Jack Ruby, shortly after he shot Lee Harvey Oswald, asked that Mr. Foreman represent him. But Mr. Ruby's family objected to what it considered Mr. Foreman's excessive fee. ''Ruby's family was quoted a figure which happened to be four times higher than the fee I had actually asked,'' Mr. Foreman said later, ''and they turned it down. I don't know how something like that happened, but it did.'' Appeals for Help

As one of the nation's best known criminal lawyers, he was constantly bombarded with appeals for help and built his practice on an unshakable loyalty to clients. ''They may not always be right, but they are never wrong,'' he once said.

It was Mr. Foreman, however, who invariably became the center of attention. In court, he was a figure to ridicule, eschewing conservative pinstripes for attention-getting black-and-white plaid sports jackets and bow ties. As he sat at the defense table, wisps of his iron-gray hair would tumble over his forehead, and as he shuffled papers, he sometimes seemed disorganized. But opponents soon learned that he was not.