With a leading position and major customers, enterprise software can become a cash cow for the right company. Just look at BEA Systems (NASDAQ:BEAS), which recently announced bountiful first-quarter results. But BEA should be warned: There's a big threat out there, and it wears a red hat.

BEA's first-quarter revenues increased by 15% to $323.2 million. Cash flow from operations came to a cool $102.4 million, up 33% from the year-ago period.

BEA develops application infrastructure software, known as "middleware," which makes it possible for businesses to serve large numbers of users via a Web application. As more and more companies have moved to the Web, demand for BEA's products has increased.

In addition, the company has expanded its product offering into an area that is getting plenty of traction: SOA (software-oriented architecture). Sure, SOA is another buzzword. But it's also a way to use Web-based technologies to help companies better integrate their IT infrastructures. And with the recent surge in merger and acquisition (M&A) activity, companies need to find ways of synching their different IT systems.

BEA's expansion has come from recent acquisitions like Aqualogic. As seen with other companies like Oracle (NASDAQ:ORCL), much of the growth in the enterprise-software space is coming from buying up other companies.

On the face of it, BEA appears to be in a good spot, right? Not necessarily. The company still gets much of its cash from its core middleware business. However, Red Hat (NASDAQ:RHAT) recently purchased JBoss, which has a low-cost open-source middleware product. Now, with the strong distribution of Red Hat, JBoss is likely to be a major threat to BEA. And given BEA's enormous cash flows, it certainly makes a juicy target.

With BEA's dominance of middleware far from untouchable, the months and years ahead could be quite interesting.

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