It isn't easy to buy and sell a home at the same time. We'll help you figure it out.

Buying a home can be a thrill. But if you're planning on selling one at the same time, that thrill can quickly change to bone-chilling terror. For most people, the mere thought of selling one home without a replacement lined up or, alternatively, shouldering two mortgages even for a day is enough to get the adrenaline flowing.

In a perfect world, you would coordinate the closings for both properties on the same day, providing a seamless transition from your old home to the new one. But the real world tends to be a bit messier than that. Many homeowners find that trying to get all parties into the same room on a certain day to close one transaction is difficult. Trying to coordinate two transactions? That's virtually impossible -- especially in some of the hotter markets where real estate professionals are stretched thin.

The good news: In today's strong housing market, homeowners should face only a short-term problem on either end of the equation. According to the National Association of Realtors, there is just a 4.2-month supply of homes on the market. That means inventory is moving very quickly. For a neutral market we would need to see a six-month supply. So your homeless state or cash crunch will -- hopefully -- be short lived.

Short-lived, but stressful nonetheless. Here are some financial coping strategies.

If You Sell Your Home First...
The fear of selling your home before you've purchased a new one is obvious: You're homeless. But experts agree that this scenario is more attractive than the alternative, which is to buy a new home before your current one has sold (more on that below). The advantage is that you have the cash to buy your new house. In the meantime, however, you might be considering moving into your moving boxes. Some better alternatives:

Rent your house
In many short-term situations, the new homeowners will allow you to rent back your old home provided you cover their costs -- particularly if you've already signed a contract to purchase another home. The process: Draw up a contract that includes a provision allowing you to stay put for a set period of time -- say, 30 days. In exchange, you agree to pay the price of the new mortgage, property taxes, utilities and homeowners insurance. Keep in mind, this may be a whole lot more expensive than what you're used to. Assuming your home has appreciated nicely in value, the new owner's expenses are probably much higher than yours were.

Move in with loved ones
If you need more than a month, you might need to move out of your old home and in with parents, a sibling or a friend. If that's not an option, consider a short-term apartment or the local Best Western. If you're forced to go this route, remember you'll have to pay movers twice and put your stuff into storage, all of which can cost a pretty penny. On the positive side, chances are Mom will be thrilled to have you back home.

If You Buy Your New Home First...
No one relishes the idea of owning two primary residents and doubling up on costs. In fact, it even makes the mortgage companies uneasy, which is why you'll need to qualify for both loans, says Holden Lewis, a mortgage expert with the Bankrate.com. If you don't qualify, you'll have to sell your old home first.

But given that this is (hopefully) a short-lived situation, lenders do loosen up their traditional standards a bit. While a typical mortgage carries a 40% debt-to-income ratio, a lender may allow a 50% to 55% debt-to-income ratio for someone temporarily straddling two mortgages, says Mark Lefanowicz, CEO and president of E-Loan, an online lender.

Provided you can qualify, here are ways to help you come up with the down payment on the new home before you have the proceeds from the old one.

Tap your home equity
The cheapest way to come up with a down payment for your new home is to borrow money via a home equity line of credit (HELOC) The interest rate should be anywhere from a quarter of a point to one point above the prime rate, which currently sits at 5.75%. Even better, the interest is tax deductible up to $100,000. Once you sell the home, you simply pay off the loan.

Keep in mind, this is something you need to line up well before you put your home on the market. Once it's clear you're aiming to sell, no bank will give you a line of credit, warns Keith Gumbinger of HSH Associates, a Pompton Plains, N.J.-based financial publisher of mortgage information. That's because, given the low fees, lenders don't make any money when they're paid off quickly.

Consider a bridge loan
If you can't tap the equity in your home, you could take out a bridge loan, also known as gap financing. It allows you to borrow money for a down payment on the new home based on the amount of equity you have in your first house. The trouble with bridge loans is that they are pretty expensive, warns E-Loan's Lefanowicz. The interest rate is often one to two percentage points above the prime rate, and there are a whole host of fees including a 1% origination fee and other closing costs. You may, however, be able to avoid some of those fees if you go to the same bank for the bridge loan that is also underwriting the mortgage for the new home, says Tony Meola, executive vice president of mortgage banking production for Washington Mutual. "In that case, (we will discount the fees since) we are looking at the entire customer relationship," he says.

Borrow from your 401(k)
If you need only a little bit of money for a down payment, or want to supplement a HELOC, you could borrow from your 401(k). Most employers allow workers to borrow either 50% of their vested balance or $50,000, whichever is less. You then have the next five to 10 years, depending on your company's rules, to repay the loan plus interest (which you pay into your account), which typically runs 1% to 2% above the prime rate.

But be warned: If you leave your job for any reason, you'll have to return the money immediately or pay the taxes and a 10% penalty. And since this is your nest egg, we would recommend paying off the loan as soon as you get the proceeds from your first home's sale.