I went through a similar situation witn a miniature poodle. 17 years old, cushings, finally couldn't walk. I would like to think I didn't make him hang around longer than necessary, but that's something I'll probably never know.
I thought I was prepared, but it was still hard. You need to do something -- exercise, make something, just move. Donate any items you do not need for another dog to an Animal Shelter.
I saved his dog tag and made it into a Christmas ornament. It's been 4 years. When I put up the tree, I always sigh, and then I smile remembering all the love and fun I had.
Another pet is not the answer, although it sometimes helps. I'm guessing you already have others, at least a grey. Spend time with them, cuddle, walk, play. They're probably missing their beagle buddy, too.
The only solution really is time.