BMC (NYSE:BMC) develops software to help companies get cost-savings from its information technology systems. The irony is that, over the past year, the company has been reducing its bloated cost structure, which is starting to result in a fatter bottom line. However, the improving stock price may have more to do with the recent surge in M&A activity in the space.

In the second quarter, BMC continued to struggle to improve its top line as sales edged up from $348.3 million to $361.4 million. License revenues, which are a key indicator of future growth, actually declined 3%, and that is certainly worrisome.

The bright side is BMC's pro forma earnings (which exclude non-cash items like stock option expenses) of $0.31 per share, which was well ahead of expectations. In fact, management upped its full-year earnings guidance to the $1.28-$1.38 per-share range.

Over the past few years, BMC has focused intensely on so-called business service management (BSM) software, which helps reduce IT costs. One happy customer is Visa, which has a massive IT infrastructure to manage roughly 100 million credit card transactions per day. By implementing BSM software, Visa thinks it can minimize costs as it scales its network to handle 160 million daily transactions by 2010.

The good news for BMC shareholders is that the buyout activity in the software space is heating up, such as with Hewlett-Packard's (NYSE:HPQ) $4.5 billion purchase of Mercury Interactive and $425 million purchase of Peregrine. IBM (NYSE:IBM) has also been acquisitive, spending $1.6 billion for FileNet (NASDAQ:FILE) and $740 million for MRO Software (NASDAQ:MROI). Essentially, mega-computer companies, which are growing slowly, view software as a way to increase growth and margins.

In light of these deals, BMC's valuation looks reasonable. Subtracting its $1.4 billion cash hoard, the company has an enterprise value of $3.5 billion and sells at roughly 2.2 times revenues. IBM's recent purchase of FileNet was at 2.6 times revenues.

The problem is that IBM and HP are buying BMC's competitors. This is likely to make it harder to grind out new business, as its competitors (backed by bigger money) can now offer more comprehensive solutions.

Another problem I've written about is that BMC generates about a third of its revenues from the mainframe market, which is declining overall.

Besides, speculating on buyout rumors is often a way to lose money quickly. What is there to support the stock when the rumors don't turn out to be true?

True, there is money to be made in the enterprise software space. But for long-term investors, the interesting play is for the mega-players -- like IBM (NYSE:IBM) and Microsoft (NASDAQ:MSFT), a Motley Fool Inside Value selection -- which have extensive distribution, market power, and discounted valuations that are interesting to value investors.

For further Foolishness:

Microsoft is an Inside Value pick. Take the newsletter for a 30-day free trial.

Fool contributor Tom Taulli does not own shares mentioned in this article.