Since memory foam mattresses can be significantly compacted, one can actually buy mattresses online for a reasonable price and shipping cost. Amazon, Overstock and other online retailers offer a wide variety of mattress sizes and types, all eligible for FedEx or UPS shipping to the customer's home.
When a memory foam mattress arrives from an online retailer, it is usually rolled into a tight cylinder and vacuum-sealed. Carefully cutting through the plastic packaging and any straps will allow the mattress to unroll, and it will expand and flatten out gradually over 24 to 48 hours.
While online retailers can offer very good prices on mattresses, they cannot allow the customer to test them out. It is wise to look for a mattress with a money-back guarantee in case it does not prove suitable.