James B. Cox, 52, retired president of the Cox Oil Co. in Suitland, died of cancer Tuesday at his home in Chevy Chase.

He founded his heating oil firm in 1962 and retired last year.

Born in Washington, Mr. Cox graduated from St. John's College High School. He served with the Navy Amphibious Forces in World War II and participated in the D-Day invasion at Cherbourg. He also took part in the invasion of southern Europe and was wounded at Toulon.

After the war, he earned a degree in accounting from Benjamin Franklin University. He rejoined the Griffith Consumers Co., where he had worked briefly before the war, and became assistant treasurer, secretary and sales manager, before founding his own firm.

Mr. Cox had served as president of the Oil Heat Institute of Greater Washington, the Community Oil Dealers Association of Southern Maryland, the Cosmopolitan Charities of Washington, D.C., and the Cosmopolitan Club, where he also was a director.

He was a member of the Metropolitan Washington Board of Trade, the Prince George's County Chamber of Commerce, the Boys' Clubs of Washington, the Merrick Boys' Camp, the Touchdown Club and the Knights of Columbus.

He is survived by his wife, Marilyn Foster Cox, and two children, Fred and Tracey, of the home; three other children, James B. Jr. and Susan Flynn, both of Olney, and Frankie F. Lucas, of Gaithersburg; two sisters, Elizabeth Dent, of Washington, and Margaret Rabbitt, of Chevy Chase; a brother, Daniel J., of Arlington, and two grandchildren.

The family suggests that expressions of sympathy may be in the form of contributions to the Vincent Lombardi Cancer Research Center at Georgetown University Hospital.