Shares of off-price retail leaders TJX (TJX -0.51%) and Ross Stores (ROST -0.75%) cratered earlier this month after several department store chains reported weak Q3 sales trends. Investors clearly feared that this slowdown in retail spending would have also affected the off-price sector.

TJX Chart

TJX vs. Ross Stores Monthly Stock Performance, data by YCharts.

However, both stocks have come roaring back in the past week and a half. TJX and Ross Stores both reported strong third-quarter results last week, demonstrating the flexibility and relative safety of the off-price business model in today's changing retail landscape.

Strong sales growth continues
In Q3, TJX grew revenue 5% year over year to $7.75 billion on a 5% increase in comparable store sales. Revenue growth would have been even higher but for a 3% negative impact from the strong dollar related to sales at the company's stores in Canada and Europe.

Meanwhile, sales rose 7% year over year at Ross Stores last quarter on a 3% increase in comparable store sales. Ross Stores doesn't operate any locations outside the U.S., so it didn't take a hit from foreign currency fluctuations.

Ross Stores posted strong sales and earnings growth last quarter. Photo: The Motley Fool.

Both companies' sales results were somewhat better than what analysts had expected. This helped dispel worries that sluggish consumer spending would hurt off-price retailers.

Earnings rising faster at Ross Stores
Earnings per share jumped 15% last quarter at Ross Stores, reaching $0.53. EPS is also up 15% year to date. By contrast, its larger rival TJX has experienced modest margin contraction this year. EPS increased just 1% at TJX last quarter, to $0.86. Year to date, TJX's adjusted EPS is up 5% over last year.

Some of the gap in earnings performance can be attributed to TJX's foreign currency exposure. For example, TJX estimated that currency fluctuations negatively affected EPS by $0.04 (or about 5%) in Q3.

Another major factor denting profitability at TJX is its decision to match other big retailers like Wal-Mart by increasing employee pay to at least $9/hour this year and $10/hour in 2016. Last quarter, this reduced EPS growth by 4 percentage points. TJX expects a similar impact next year before the cost increases slowly thereafter.

Ross Stores also increased its minimum wage to $9/hour recently. However, it has managed to continue growing its profit margin this year, due to higher gross margin combined with cost efficiencies found across the business. That said, it expects margin pressure to increase in Q4 due to the wage increases, higher distribution center costs, and tougher year-over-year comparisons.

TJX looks like the better pick
TJX and Ross Stores are both well-managed retailers with solid margins and ample growth opportunities. However, despite Ross Stores' faster earnings growth this year, TJX will probably outperform it over the long haul.

Ross Stores ended October with 1,448 total stores, and estimated that it could ultimately grow to about 2,500 stores across the U.S. That would represent an increase of more than 70%.

Despite its massive size, TJX has plenty of room left for growth. Photo: The Motley Fool.

TJX is significantly larger, with 3,594 stores as of the end of October. However, it still sees plenty of room for growth. Earlier this year, TJX estimated its long-term growth opportunity at 5,475 stores, which would be an increase of more than 50%. TJX also routinely increases its estimated growth opportunity each year, so its ultimate ceiling is probably much higher.

What really sets TJX apart from Ross Stores is its international footprint and its stand-alone U.S. home fashions chain, HomeGoods. These business segments have more room for expansion and have been posting faster comp sales growth recently than the company's flagship T.J. Maxx and Marshalls chains. They also have margin expansion opportunities -- particularly TJX Europe -- as they grow to scale.

TJX and Ross Stores both showed last week that they can prosper in almost any retail climate. That's why they are both likely to continue outperforming. However, among these two companies, TJX is the better bet for long-term investors.