It's simple. Mind numbingly simple, because of the "features" available in the computer program that does this stuff.
Every class of ticket (bedroom, roomette, coach on the LD trains, business/first on Acela, etc) are broken into 4 or 5 price buckets.
So the fare structure of the Cap Limited from WAS-CHI might look something like this:
Code:
BUCKET COACH ROOMETTE BEDROOM
1 $100 $150 $200
2 $125 $200 $300
3 $150 $250 $400
4 $175 $300 $500
5 $200 $350 $600
In the olden days, that's it (OK, it's a little more complicated, there are actual letter codes for the bucket that you can see printed on your ticket, and I think that either coach or the sleepers have 4 buckets not 5, but the theory is there). No more complicated than that. Once all the $100 coach tickets are sold out, the price becomes $125. If most of the roomettes on the train are sold, an comparatively few bedrooms are sold, it's possible for a bedroom to be cheaper than a roomette.
Nowadays, Amtrak is getting a little more proactive about revenue management (they've always had the capability, but it seems they are doing that more often these days). Revenue management consists of Amtrak keeping an eye on how many tickets are sold, and adjusting the number of tickets in each bucket (or eliminating some buckets altogether) to maximize revenue. There's a thread around here on pricing for the SWC that indicates that as the rooms are made available for booking 11 months out, they were released at a higher bucket first to get more money out of people savvy enough to book as soon as they became available, but not savvy enough to cancel and rebook when the prices dropped a month later.
That's in in a nutshell - I've glossed over a lot and overgeneralized a bit, but if you can understand this, you've got the big picture.