Catholic moral principles for the treatment of the dying are set forth in a document published by the U.S. Conference of Catholic Bishops entitled “Ethical and Religious Directives for Catholic Health Care Services.”
Those directives provide that “in principle, there is an obligation to provide patients with food and water, including medically assisted nutrition and hydration for those who cannot take food orally,” because, as you rightly state, it would be morally wrong to “starve the patient to death” (No. 58).
But that same section of the directives goes on to explain that medically assisted nutrition and hydration become “morally optional” when there is no reasonable expectation of prolonging life or when such means would be “excessively burdensome” for the patient or cause significant physical discomfort.
As for medication, the directives address your question directly: “Medicine capable of alleviating or suppressing pain may be given to a dying person, even if this therapy may indirectly shorten the person’s life so long as the intent is not to hasten death” (No. 61).
Since hospice care is offered both by religious and secular institutions, it would be best to seek that care in a Catholic facility, thus ensuring that Catholic moral guidelines would be observed.
An important aspect, too – and sometimes families and even physicians might overlook this – is that, when possible, dying patients themselves should be consulted about the morally legitimate treatment options available.