The yellow caution light has gone on at K mart Corp., the discount retailer known for its "blue-light specials."

Standard & Poor's Corp., one of the nation's leading financial rating firms, has put the company on notice that it might lower K mart's credit ratings because it is concerned about how well K mart, the nation's second-largest retailer, is faring in the increasingly competitive retail market.

This cautionary note, issued late last week, comes at a time when competition in the retailing industry is hotter than ever -- even though consumer spending has cooled substantially during the past 18 months.

K mart officials refused to discuss S&P actions yesterday but industry experts said it represented a warning not only for K mart but for other discounters and well-established retailers that have been slow to react to the intensified competitive pressures.

"There is a bell going off," said Louis Stern, a marketing professor at Northwestern University's J. L. Kellogg Graduate School of Management. "The bell doesn't mean that K mart is going to fail."

However, he added, it does signal problems for K mart and other retailers such as Sears "who have stood in the middle of the road, bumping along with not enough excitement" to keep customers from going to their new, more focused competitors, including the specialized discount stores (such as Trak Auto Corp.) or the warehouse clubs (such as the Price or Pace Club), Stern said.

K mart has a particular problem with the rash of discounters that have cropped up to compete with the nation's largest discount chain. On the one hand are the lower priced Wal-Mart stores; at the other end are stores selling higher priced goods such as Bradlees, which likes to call itself the "upscale discounter." K mart is caught in the middle of a discount war, neither "an upscale discounter or a downscale discounter" that draws particularly loyal customers, Stern added.

Sales for the chain last year were $22.4 billion. While that was a 6.2 percent increase from the previous year, it was "well under the mid-year projections of $24 billion," noted S&P's retailing analyst Kerekin Der Sahagian.

Profits for the fiscal year that ended Jan. 30 totaled $221.2 million, down from the $499.1 million earned in 1985. Even discounting the $250 million write-off the company took in 1986 for discontinuing two operations -- its insurance subsidiary and a joint venture in Mexico -- the company's profits for 1986 still were lower than last year -- $471.2 million, compared with $498.7 million in 1985.

"K mart should be doing better than it has," Sahagian said. "It has been diversifying and upgrading, but these have not generated bottom-line results."

One reason is that what they are doing, everyone else is trying to do the same thing."

In the past two years, K mart -- which has about 20 percent to 25 percent of the discount market -- has been actively trying to upgrade its stores and its merchandise to lure a more affluent shopper. At the same time, realizing that with 2,200 K mart stores there are few new places to set up new units, the company has been seeking to expand its business by diversifying into other retail areas.

It has purchased Walden Books, the northwestern drugstore chain Pay Less Drug Stores and a do-it-yourself home-center company that it has renamed Builders Square.

Yet these moves so far have not paid off, Wall Street officials said yesterday, as the stock closed down 37.5 cents at $43.75 a share.

"They are wasting a ton of money in their new activities," said Terence J. McEvoy of Smith Barney, Harris Upham & Co.

"Nobody is making money in the warehouse do-it-yourself business. They have undertaken a huge expansion effort without sufficient capability for the drugstores, and Walden Books had already peaked when they bought it. It was a full-price retailing in an industry that was going discount. They responded, and that has hurt K mart's margins," McEvoy said.

S&P's Sahagian said the rating company hoped to meet with K mart officials by mid-spring to make a decision.

S&P rates K mart's senior debt at A-plus and its convertible subordinated debt at A. S&P's top rating is AAA.

Moody's Investor Service, the other major rating service, said K mart's ratings are "not under official review at this point in time," said analyst John Dean. For senior debt, Moody's gives K mart an A-1; and a lower A-2 rating for its convertible subordinated debt.