There are some cases where both Herbert's and Thorsten Donig's answers can be problematic. One situation is when the stuff at the end needs a new line, but that line also starts a new page. This makes an especially awkward widow, since it would start a page flushed right. The other potential problem involves hyphenation. Herbert's solution does not work properly on lines that are started by hyphenated words (it starts a new line even if there is enough space to flush right), and Thorsten Donig's solution seems to break hyphenation of the preceding word.
\documentclass{article}
\usepackage[papersize={10cm,5cm},textwidth=5cm,vmargin=5mm]{geometry}
\usepackage{calc,parskip}
\newcommand{\atend}{\makebox[2em][l]{\leaders\hbox{b}\hfill}}
\newcommand{\fillpage}{\vspace*{\textheight}\vspace*{-2\baselineskip}\vspace{-\parskip}}
\overfullrule=2pt
\pagestyle{empty}
\begin{document}
\fillpage
\newcommand\comfyfill[1]{{% = Herbert's \When
\leftskip=0ptplus1fil\rightskip=-\leftskip\parfillskip=\leftskip
\hfill \phantom{ } \textit{\mbox{#1}}\par}}
\makebox[\textwidth-2em]{\hrulefill a}\comfyfill{\atend}
\makebox[\textwidth-\widthof{charac- }]{\hrulefill} characterisation \comfyfill{\atend}
\makebox[\textwidth-\widthof{charac- }]{\hrulefill} charac- terisation \comfyfill{\atend}
\newpage
\fillpage
\renewcommand*{\comfyfill}[1]{% = Thorsten Donig's \signed
\unskip\hspace*{1em plus 1fill}
\nolinebreak[3]%
\hspace*{\fill}\mbox{\emph{#1}}
\parfillskip0pt\par
}
\makebox[\textwidth-2em]{\hrulefill a}\comfyfill{\atend}
\makebox[\textwidth-\widthof{charac- }]{\hrulefill} characterisation \comfyfill{\atend}
\makebox[\textwidth-\widthof{charac- }]{\hrulefill} charac- terisation \comfyfill{\atend}
\end{document}
Here is the output from Herbert's solution:

An here is the output from Thorsten Donig's:

\signed
macro in the TeXbook (chapter 14, p. 106) does...