TROY, Mich. (AP) _ K mart Corp. says spending for new and renovated stores left it with a $20.5 million loss for the fourth quarter of 1989.

The nation's second-largest retailer may have to do more than that to hold off challengers like fast growing Wal-Mart Stores Inc., analyst Sally Schaadt of Fourteen Research in New York said Thursday.

''It would seem to me that if you have problems, it's probably not just the size of the store,'' Schaadt said. ''It's probably something in their merchandise mix, something in their pricing, something in their promotional activities.''

K mart Chairman Joseph E. Antonini said earlier this month that costs of speeding up a $2.3-billion store expansion and renovation program, now slated for completion in 1994, would cut profits.

He said K mart also cut prices to hold onto market share, which also ate into earnings.

''We have already opened several prototype stores and have enlarged and relocated many of our stores,'' Antonini said. ''In the enlarged, relocated and prototype stores, customer acceptance of the layouts, fixturing and new merchandise assortments has been very good and sales results have exceeded expectations.''

K mart said its results worked out to a loss of 10 cents a share for the 14 weeks ended Jan. 31, compared with a net profit of $393.2 million, or $1.96 a share, during the 13-week period ended Jan. 25, 1989.

Revenues for the latest quarter amounted to $9.75 billion, a 16-percent jump from $8.42 billion the year before.

The results included an after-tax charge of $416.1 million as part of the restructuring program, spokesman Oren F. Knauer said. Without it, the company said earnings would have been $395.6 million, or $1.97 a share.

For the year ended Jan. 31, the company said earnings fell 59.8 percent to $322.7 million, or $1.61 a share, from $802.9, or $4 a share, the year before. Revenues rose to $29.53 billion from $27.3 billion.

The decrease included a $422.5 million after-tax charge for the year for the construction and renovation program.

K mart is the nation's second-largest retailer in terms of sales after Sears, Roebuck & Co.

Wal-Mart, the Arkansas-based discount chain that is No. 3 in sales, has leapfrogged K mart in profits, reporting $1.1 billion in 1989 earnings on sales of $25.8 billion.

K mart said Thursday that gains in clothing lines helped boost its February sales 14.7 percent from February 1989. Sales at stores open at least one year were up 4.4 percent.