This is going to vary a lot depending on the budget of the series. The difference between high budget and low budget series is big enough that applying this to any individual anime is probably not a very good approximation. As an aside, this is essentially a rehash of my answer here, though the question is different enough that I don't think it's a duplicate.
A single episode of a typical anime today costs roughly 10 million yen. This Cruncyroll article from 2011 lists the following breakdown of costs for one single 30 minute episode of a 2011 anime had the following breakdown of costs:
Original work - 50,000 yen ($660)
Script - 200,000 yen ($2,640)
Episode Direction - 500,000 yen ($6,600)
Production - 2 million yen ($26,402)
Key Animation Supervision - 250,000 yen ($3,300)
Key Animation - 1.5 million yen ($19,801)
In-betweening - 1.1 million yen ($14,521)
Finishing - 1.2 million yen ($15,841)
Art (backgrounds) - 1.2 million yen ($15,841)
Photography - 700,000 yen ($9,240)
Sound - 1.2 million yen ($15,841)
Materials - 400,000 yen ($5,280)
Editing - 200,000 yen ($2,640)
Printing - 500,000 yen ($6,600)
for a total of about 11 million yen.
This image (in Japanese) is a breakdown of the costs of a single episode of the series Bamboo Blade. As you can see, the price comes in at just under 10 million yen. This site has some more info, as does this list (though not everything there is anime and most is old). But the bottom line is that the market price is roughly 10 million yen per episode, which comes out to 230 yen per frame. Some of that goes to things other than animation, but the bulk is for art and animation costs.
As for the source, the production company typically self-funds its own original anime. For example, Puella Magi Madoka Magica was funded by Aniplex. For adaptations, the publishing company typically provides some or all of the funding, as it serves as a form of advertising for the original. The details on these arrangements are very secret and can vary a lot.
Note that the production company also has to pay for the TV run in most cases, since late-night TV slots are purchased by production companies as a form of advertising for their final product e.g. DVDs (see Why does anime usually air at night in Japan? for more information on this). According to this blog post, for a 52-episode series airing on 5-7 stations, this would be in the ballpark of 50 million yen, or about 1 million yen per episode. They typically only make back their money at the point of DVD sales, which is why studios never know exactly how much money they're able to invest on a new series.