Heat oven to 375 degrees. Coat a 1-1/2-quart baking dish with nonstick cooking spray. Spread 1 can of the refried beans into prepared dish. Top with 1/2 cup of the salsa and 1 cup of the cheese. Stir remaining can of beans to loosen, then carefully spread over cheese layer. Top with remaining 1/2 cup salsa and 1 cup cheese.
Cover dish with foil and bake at 375 degrees for 30 minutes. Meanwhile, microwave chili powder in a small glass dish for 45 seconds until toasted. Stir into sour cream.
In a small bowl, combine red onion, vinegar and sugar. Set aside.
Remove warm dish from oven. Uncover and top with sour cream, tomatoes, lettuce, avocado and pickled red onions. Serve with chips.