The stock market has surged this year, and tech stocks have done particularly well. While the S&P 500 is up about 19% year to date, the tech-heavy Nasdaq Composite has soared roughly 37 %.

The number of tech stocks that look cheap relative to earnings or free cash flow has shrunk as the stock market has rallied. However, there are still some good options for value investors. Telecom giant AT&T (T 1.02%) and hybrid cloud leader International Business Machines (IBM -1.05%) remain solid bargains in a rising market.

AT&T

While rival Verizon continues to lose consumer wireless customers, AT&T is having little trouble snagging new subscribers. The telecom giant added 326,000 net postpaid phone subscribers during the second quarter, and it tacked on 167,000 prepaid subscribers as well. Importantly, the company's churn rate remained low. For postpaid phones, churn was just 0.79%.

Beyond the wireless business, AT&T's fiber internet business is now big enough to largely offset ongoing declines in legacy wireline services. The company added 251,000 fiber customers in the second quarter, bringing the total customer count to 7.7 million. The consumer fiber business now generates more than $1.5 billion in revenue each quarter, and the average revenue per user has been steadily increasing.

While AT&T's growth strategy is working, there are two major risks to consider. First, the company's balance sheet is overflowing with debt. Net debt stood at $132 billion at the end of the second quarter. AT&T is working to reduce this debt, but it will be a slow process. The interest AT&T pays may ultimately trend upward because of rising rates as old debt is refinanced, potentially putting pressure on free cash flow.

Second, AT&T faces an unknown exposure to the Federal investigation into lead-covered telecom cables. The company has said that less than 10% of its network uses lead-covered cables, and that most such cables are either buried or in conduit. But there's always the chance that this blows up into a nightmare involving legal settlements and costly mitigation.

While investors shouldn't ignore these risks, AT&T's rock-bottom valuation provides a big margin of safety. The company expects to generate at least $16 billion of free cash flow this year, which puts the price-to-free-cash-flow ratio at a paltry 6.5. A dividend yield that tops 7.5% is also enticing.

Free cash flow growth may be slowed down by a tough economy and rising interest payments, but AT&T stock is so cheap that it barely matters.

International Business Machines

IBM's decade-long turnaround has been gaining traction, fueled by the company's hybrid cloud computing business. The tech giant, now unencumbered by the low-margin managed infrastructure services business it spun off in 2021, is in a far better position today than it was even a few years ago.

There are still plenty of legacy businesses within IBM, including transaction processing software and mainframe systems. But three-quarters of revenue now comes from software and consulting, and half of all revenue is now recurring in nature.

Non-transaction-processing software revenue grew by 7% year over year in the second quarter adjusted for currency, led by double-digit growth for Red Hat, data analytics, and AI. Red Hat's OpenShift is a leading containerization platform that forms the foundation of IBM's hybrid cloud offerings, and the company is looking to grow its AI business with the launch of its watsonx platform this year.

The consulting business is also growing, with revenue up 6% in the second quarter. While IBM is seeing less interest among clients in some areas due to a tough economy, digital transformation projects that can deliver significant cost savings and efficiency gains remain in demand. Big organizations looking to modernize their IT operations need not only software but also guidance. IBM can deliver both.

On top of growing revenue by 3% to 5% this year adjusted for currency, IBM expects to boost its free cash flow by more than $1 billion to $10.5 billion . The stock trades for just over 12 times this free cash flow guidance. That's not nearly as cheap as AT&T, but IBM faces fewer risks and will likely prove more resilient in a recession. For investors searching for value, IBM stock is tough to beat.