Sleeping cars have their earliest history dating back to 1839 with the construction of the Chambersburg, built by the Cumberland Valley Railroad. The car featured bunks stacked as many as three high with the bunk nearest the floor convertible into a seat. These types of sleeping arrangements were known as berths (whereby the seat folded out into a bed setup), and were common through the mid-20th century. While sleeping arrangements on passenger trains became an increasingly common service after the construction of the Chambersburg it wasn't until the opening of George Pullman's Pullman Palace Car Company in 1867 did the sleeper really come of age.
Pullman would perfect the car and became so successful that the term "Pullman" generally described the car, even if a particular one wasn't built by the company. Early car designs offered some type of berth arrangement whereby the seats could be laid out into a bed. As the face of sleeper service on passenger trains Pullman, which operated all on board car services and generally the company's equipment was painted a dark, forest green unless the owning railroad specified it match a particular livery or color (for instance, if the train had a themed livery). However, with the coming of the streamliner era in the 1930s this all changed.
While increased sleeping services began to take hold in the first part of the 20th century, new innovative designs and layouts during the streamliner era meant passengers had a wide range of options to choose from regarding their sleeping arrangements. Instead of simply the option of a berth most sleepers on board famous trains like the 20th Century Limited, Super Chief, and Empire Builder carried the choice of a berth, roomette (somewhat like a berth but it also was a small enclosed room with more privacy), or a full bedroom (which featured, among other things, a full private bath). Also, after World War II Pullman's on board services were taken over by the railroads themselves although the company continued to manufacture cars.
And, while Pullman was the leader of the passenger railroad equipment industry it did face strong competition from the Budd Company. Budd not only helped build one of the most successful original streamliners, the Chicago, Burlington & Quincy Railroad's Zephyr 9900 the company also fully equipped a number of famous passenger trains like the Santa Fe's Super Chief. Budd's success in the industry had as much to do with the exterior of its equipment as the interior where it invented and owned the patent on the stainless-steel, streamlined rail car design. During the streamliner era several prestigious passenger trains would tout "all-Pullman" status, meaning the train was entirely made up of Pullman equipment, many of which featured sleeping arrangements.
For instance, aboard a typical 14-car consist of the Union Pacific's City fleet, eight or more of the cars included either full sleeping arrangements or some combination of them (such as the rear sleeper-observation car which featured double bedrooms in the front section and lounge furnishings and the back). Interestingly, though, Union Pacific and other railroads wouldn't always refer to their sleepers as such, instead calling them Bedroom cars. They were often designated by the exact layout of the car such as a 8 Double Bedroom, 1 Compartment, 1 Section (also referred to as an 8-1-1 arrangement); or a 6 Section, 6 Roomette, 4 Double Bedroom (also referred to as a 6-6-4 arrangement). These designations were used for years to describe the layout of sleepers and they can be confusing to decipher without the benefit of the name beside the numbers.
Today, Amtrak still offers sleeping services, even full bedrooms which can be purchased aboard their Superliner, bi-level cars. However, gone are the days of purchasing berths in open sections as to allow for greater privacy Amtrak features only private rooms. For instance, here are the amenities and available options aboard today's Texas Eagle. While Pullman exited the passenger train market around the same time railroads did their cars and equipment are still revered today, some of which have been restored by private collectors and are certified to operate on the rear of Amtrak trains (at a very steep cost I might add).
Related Reading You May Enjoy
Passenger Train Cars