Updated from 10:40 a.m. EDT

Red Hat

(RHAT)

has agreed to buy JBoss, one of the industry's hottest open source software companies, for up to $420 million in stock and cash.

The surprise announcement on Monday was greeted enthusiastically on Wall Street, where investors pushed up shares of Red Hat by $2.37, or 8.6%, to $29.80 in recent trading.

Privately held JBoss was widely believed to be in acquisition talks with

Oracle

(ORCL) - Get Report

earlier this year, a rumor neither side ever confirmed. The smaller company sells support for its popular application server, a middleware program that helps disparate software systems to work together.

Red Hat as emerged as the most important provider of Linux, a free operating system that has had great success in recent years, particularly against Unix, the operating system traditionally favored by large businesses. Linux has even begun to challenge

Microsoft's

(MSFT) - Get Report

Windows, although that battle is still in its early stages.

For its part, Oracle has moved beyond its traditionally core database business and is attempting to build a complete software "stack" that businesses would use to run their computing infrastructure. Although Oracle sells its own brand of middleware, JBoss' software likely would have helped it compete more effectively against competitors such as

BEA Systems

(BEAS)

, a major middleware provider.

Red Hat will initially pay $350 million for JBoss, and will throw in $70 million more if certain future performance goals are met. Red Hat will pay about 40% of the acquisition price in cash and 60% in stock. The company expects to close the acquisition around the end of its fiscal first quarter in May.

The acquisition adds heat to the already fierce competition in the software infrastructure market. "

IBM

(IBM) - Get Report

and Oracle helped Red Hat establish its dominant market position in the U.S. and a number of other geographies, motivated perhaps by the desire to undermine Microsoft and

Sun

(SUNW) - Get Report

with a Linux offering. This now appears to be backfiring on them, having helped to create another competitor in the infrastructure software market," wrote Goldman Sachs software analyst Rick Sherlund.

Oracle has acquired several Open Source companies this year, including Sleepycat and Innobase, moves that Sherlund views as a defensive play against Red Hat. Goldman Sachs has an investment banking relationship with Red Hat.