Once on a rebuild I had a really hard time getting the rear brake to feel solid, after having tried all sorts of tricks. The rebuild included starting from new empty brake hoses and new calipers (ZRace).
So I lifted the frame up against the garage wall to ensure the hose pointed down all the way from the shifter to the caliper, and used some elastic bands to keep the brake lever pressed in. I left it like that overnight. The next day took the frame down from the wall, put the wheel back, and did a lever bleed (exactly as jonathanf2 describes above). Lots of air bubbles came out, and the result was an extremely solid brake feel - even better than for the front brake that I was already satisfied with.
Photos attached, keep in mind that I use the left lever for the rear brake.