Although there is no legal obligation for a deceased person's relatives to pay for a funeral, the closest living relative is usually the one who must pay for any burial and funeral costs. Without anyone willing to step forward and arrange payment, there simply won't be a funeral. If the family has no funds to pay for a funeral or burial, the county may handle disposal of the body.
Generally, the executor or administrator of your loved one's estate (who is appointed in the will) is responsible for planning and paying for the funeral. When there is no executor named in the will or there is no will, the probate court will choose an executor, typically the next of kin. If your loved one had assets or an end-of-life plan, their estate should be able to cover the costs.