The funding is aimed at reducing waiting times for non-Covid emergency care, with a spike in A&E attendances putting hospitals under additional pressure.
It comes as the latest figures show Scotland recorded seven deaths of coronavirus patients and 2,190 cases in the past 24 hours.
Health secretary Humza Yousaf said urgent treatment, including vital cancer care, would continue as the health crisis persists.
The government is also urging people to help the NHS by considering options closer to home when they need medical attention such as calling the 111 service.
A number of hospitals have announced they have reached capacity and postponed non-urgent surgery.
Mr Yousaf said: "We are acutely aware that hospitals are facing significant challenges due to a rise in non-Covid attendances and that some health boards are taking necessary measures to protect urgent and emergency care capacity. This £12m will support them to do so.
"We are working closely with those health boards experiencing the greatest challenges to ensure the funding delivers the improvements required.”
He added: "Our NHS staff continue to work tirelessly to respond to the pandemic whilst providing vital non-Covid treatment and safe patient care.
"Any reductions to service will be short-term to ensure those of most critical need have immediate medical attention. Urgent treatment, including vital cancer treatment will continue during this challenging period."
NHS Lothian chief executive Calum Campbell said: "Hospitals across Scotland are dealing with the pandemic, while seeing an increase in non-Covid patients arriving at their doors.
"We are grateful to the Scottish Government for working with us to ensure everyone who needs urgent or emergency care is prioritised - such as vital cancer treatment or accident and emergency care for life-threatening conditions.”
The Scottish Government's figures today (Saturday) reported 435 people were in hospital with recently confirmed Covid-19, with 42 patients in intensive care.
The daily test positivity rate was at 9 per cent.
So far, 3,920,145 people in Scotland have received the first dose of a Covid-19 vaccination and 2,861,110 have received their second dose.