From the Latin via, meaning 'road', and -ic, meaning 'of', 'relating to', or 'characterized by'. At some point someone tacked an -al onto the end, which in this case doesn't mean anything. Viatical is an exact synonym for viatic, but in recent times viatical has become the preferred usage. 'Viatical' first appeared in 1847, according to the OED.

Viatical obviously means 'having to do with the road'; a viatic(al) plant is one that grows on roadsides or along paths. It is also used to refer to traveling ("I'm feeling viatical today!"). It can also be used to refer to articles used for traveling; spare wheel, map, AAA card -- my viaticals. Or for travelling expenses, although viaticum might be a more appropriate word for this.

In medieval times a viatic was the Eucharist that was given to someone dying or in danger of death. Because of this the term viatical settlement is now used in reference to buying life insurance policies from terminally ill policy holders -- you give them some money with which to enjoy their last days, and they name you as beneficiary. (see the National Viatical Association.) The person selling the policy is called a viator (yes, that is the official legal term). And yes, this is legal.