Eating Candy in the Correct Order
CJam, 78 68 61 45 42 39 31 30 bytes
l$:L{L\/,~}${:DM+:MD/,LD/,d/}$

Takes the input string via STDIN
Inspired by recursive's approach, but a little different. No need of transpose or rectangle at all!.
How it works:
l$:L                              &quot;Sort the input line and store it in L&quot;;
    {     }$                      &quot;Sort the string based on this code block output&quot;;
     L\/,~                        &quot;Sort based on number of occurrences of each&quot;;
                                  &quot;character in the full string&quot;;
            {               }$    &quot;Sort the sorted string again&quot;;
             :DM+:M               &quot;Store each character in D, add to M and update M&quot;;
                   D/,            &quot;Count occurrences of D in M&quot;;
                      LD/,        &quot;Count occurrences of D in L&quot;;
                          d/      &quot;Sort string based on the ratio of two occurrences&quot;;

(Sad that CJam can no longer complete with Pyth due to need of so much bloat as syntax)
Try it here