Residents have been evacuated from part of the Kincaidston area following the incident on Monday evening.
Social media users said they heard the explosion from miles away, while pictures shared online showed at least one house badly damaged with debris lying in the street.
Police Scotland said inquiries were continuing into the cause of the explosion and they will carry out a joint investigation with the Scottish Fire and Rescue Service (SFRS).
In a statement, the force said four houses had been affected by the explosion, with “a number of premises evacuated” and two rest centres set up to assist.
Emergency services were called to the scene on Gorse Park at around 7.10pm, police said, adding that local road closures were in place and the public were advised to avoid the area.
“Two adults and two children have been taken to Crosshouse Hospital in Kilmarnock,” the force said.
Local councillor Chris Cullen told BBC Good Morning Scotland that gas caused the explosion.
Describing the scene, he told the programme: “It is quite harrowing actually.
“Early yesterday evening there was a row of houses and now there is a hole.
“Two-and-a-half houses are missing. It is quite shocking how far the debris has fallen and the damage it has caused.”
He added: “It has been a gas explosion, the exact details of how that happened aren’t released yet.”
Euan Bryson, who lives in the adjacent housing estate, tweeted a video showing a fire engine on a smoke-filled street in the aftermath of the explosion.
He said: “Was chaotic. There was personal property and rubble all over the scene.
“The video below doesn’t even do the smoke justice. Could scarcely make out peoples’ faces.”
SFRS said nine fire engines, as well as specialist appliances, were sent to the scene with two remaining on site at 10.30am on Tuesday.
Ian McMeekin, SFRS Area Commander, said: “Our thoughts are with everyone who has been affected by this incident.
“This has been an extremely complex and challenging incident which significantly damaged multiple properties in the area and resulted in the evacuation of other nearby homes. We will remain in attendance for some time as we work with our partners to ensure the area is safe.
“A joint investigation alongside Police Scotland will be carried out in due course to establish the full facts and circumstances.”
A spokeswoman for the Scottish Ambulance Service said: “We received a call at 7.16pm to attend an incident at Gorse Park, Ayr, alongside Police Scotland and the Scottish Fire and Rescue Service.
“We dispatched a number of resources to the scene, including three specialist operations vehicles, six ambulances and an air ambulance.”
The friend of a woman whose house was directly opposite the blast site in Kincaidston described the scene as “something you cannot comprehend unless you see the sheer scale of the damage”.
Moira Muir, 59, told the PA news agency: “Her lounge window was blown in and the radiator in her upstairs bathroom was blown off the wall.”
Ms Muir, who runs a holiday home rental in North Ayrshire, rushed to her friend’s aid within 30 minutes of the explosion and added that: “The smell of smoke was quite overpowering, but the biggest shock was seeing the amount of rubble and how far it had travelled.
“I have never seen anything like it.”
Marcus Tindal-Wiles, 25, who lives near to where the blast occurred, said he’s “never felt anything like it before”.
He told PA: “The entire building shook from the shockwave.”
South Ayrshire Council said it is working with emergency services to determine who will be able to return to their house and who will not due to “ongoing building safety concerns”.
It is working to establish a reception centre in the area for anyone returning and said it aims to get people back home as soon as possible, but can only do this once it is confident properties are safe.
The council said: “Once we know who may still require accommodation, our housing teams will work with residents to support them.
“As soon as we are clear where the inner cordon lies we will start the clear-up operation, which requires to be done with sensitivity due to personal effects being included among general debris.”
Gas distribution company SGN was helping emergency services.
A spokesman said: “Our engineers are currently assisting the emergency services to ensure the immediate vicinity is made safe in our role as the gas emergency service.”